Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #1448 > unrolled thread

getting only the temperature & general weather condition

Started byEvolution <cryptozoan@gmail.com>
First post2011-05-06 15:22 -0700
Last post2011-05-07 20:39 -0400
Articles 15 — 4 participants

Back to article view | Back to comp.lang.php


Contents

  getting only the temperature & general weather condition Evolution <cryptozoan@gmail.com> - 2011-05-06 15:22 -0700
    Re: getting only the temperature & general weather condition Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-06 21:23 -0400
      Re: getting only the temperature & general weather condition bill <nobody@spamcop.net> - 2011-05-07 06:07 -0400
        Re: getting only the temperature & general weather condition Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-07 07:17 -0400
          Re: getting only the temperature & general weather condition bill <nobody@spamcop.net> - 2011-05-07 07:28 -0400
            Re: getting only the temperature & general weather condition Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-07 07:40 -0400
      Re: getting only the temperature & general weather condition Evolution <cryptozoan@gmail.com> - 2011-05-07 03:21 -0700
        Re: getting only the temperature & general weather condition Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-07 07:23 -0400
          Re: getting only the temperature & general weather condition Evolution <cryptozoan@gmail.com> - 2011-05-08 00:07 -0700
            Re: getting only the temperature & general weather condition Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-08 08:11 -0400
              Re: getting only the temperature & general weather condition Evolution <cryptozoan@gmail.com> - 2011-05-08 16:29 -0700
                Re: getting only the temperature & general weather condition Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-08 21:53 -0400
    Re: getting only the temperature & general weather condition MacRoks <macroks@aim.com> - 2011-05-06 22:24 -0400
      Re: getting only the temperature & general weather condition Evolution <cryptozoan@gmail.com> - 2011-05-07 03:17 -0700
        Re: getting only the temperature & general weather condition MacRoks <macroks@aim.com> - 2011-05-07 20:39 -0400

#1448 — getting only the temperature & general weather condition

FromEvolution <cryptozoan@gmail.com>
Date2011-05-06 15:22 -0700
Subjectgetting only the temperature & general weather condition
Message-ID<3ee924e7-17da-4cd0-95f6-b74d235ed084@z7g2000prh.googlegroups.com>
On phpbuilder.com,  I found the following:

   http://www.phpbuilder.com/board/showthread.php?t=10283087

which discusses how to obtain the current weather for a feed closest
to you.

I modified the code to my site but didn't get the same results as
shown by Kudose (a poster at the bottom of that same page).

My code is:
<?
session_register();
session_start();
$url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
$xml = simplexml_load_file($url);

echo '<b>Santa Barbara weather: </b><br />';
echo $xml->weather, '<br />';
echo $xml->temperature_string, '<br />';
echo $xml->relative_humidity, '% humidity <br />';
?>

and the impaired results are on a test page at:

   http://www.geol.ucsb.edu/library/php/weather.php

Can anybody point me in the right direction?  I'm essentially a
newbie.
Thanks!

[toc] | [next] | [standalone]


#1450

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-05-06 21:23 -0400
Message-ID<iq26ui$hf1$1@dont-email.me>
In reply to#1448
On 5/6/2011 6:22 PM, Evolution wrote:
> On phpbuilder.com,  I found the following:
>
>     http://www.phpbuilder.com/board/showthread.php?t=10283087
>
> which discusses how to obtain the current weather for a feed closest
> to you.
>
> I modified the code to my site but didn't get the same results as
> shown by Kudose (a poster at the bottom of that same page).
>
> My code is:
> <?
> session_register();
> session_start();
> $url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
> $xml = simplexml_load_file($url);
>
> echo '<b>Santa Barbara weather:</b><br />';
> echo $xml->weather, '<br />';
> echo $xml->temperature_string, '<br />';
> echo $xml->relative_humidity, '% humidity<br />';
> ?>
>
> and the impaired results are on a test page at:
>
>     http://www.geol.ucsb.edu/library/php/weather.php
>
> Can anybody point me in the right direction?  I'm essentially a
> newbie.
> Thanks!

The code works for me.


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#1454

Frombill <nobody@spamcop.net>
Date2011-05-07 06:07 -0400
Message-ID<lr-dnSAMQLtAhFjQnZ2dnUVZ_qOdnZ2d@cablespeedmi.com>
In reply to#1450
On 5/6/2011 9:23 PM, Jerry Stuckle wrote:
> On 5/6/2011 6:22 PM, Evolution wrote:
>> On phpbuilder.com, I found the following:
>>
>> http://www.phpbuilder.com/board/showthread.php?t=10283087
>>
>> which discusses how to obtain the current weather for a feed
>> closest
>> to you.
>>
>> I modified the code to my site but didn't get the same results as
>> shown by Kudose (a poster at the bottom of that same page).
>>
>> My code is:
>> <?
>> session_register();
>> session_start();
>> $url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
>> $xml = simplexml_load_file($url);
>>
>> echo '<b>Santa Barbara weather:</b><br />';
>> echo $xml->weather, '<br />';
>> echo $xml->temperature_string, '<br />';
>> echo $xml->relative_humidity, '% humidity<br />';
>> ?>
>>
>> and the impaired results are on a test page at:
>>
>> http://www.geol.ucsb.edu/library/php/weather.php
>>
>> Can anybody point me in the right direction? I'm essentially a
>> newbie.
>> Thanks!
>
> The code works for me.
>
>
On Firefox 3.17 I get
----------------------
Santa Barbara weather:


% humidity
--------------------
which is not the desired result

bill

[toc] | [prev] | [next] | [standalone]


#1457

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-05-07 07:17 -0400
Message-ID<iq39od$nvt$1@dont-email.me>
In reply to#1454
On 5/7/2011 6:07 AM, bill wrote:
> On 5/6/2011 9:23 PM, Jerry Stuckle wrote:
>> On 5/6/2011 6:22 PM, Evolution wrote:
>>> On phpbuilder.com, I found the following:
>>>
>>> http://www.phpbuilder.com/board/showthread.php?t=10283087
>>>
>>> which discusses how to obtain the current weather for a feed
>>> closest
>>> to you.
>>>
>>> I modified the code to my site but didn't get the same results as
>>> shown by Kudose (a poster at the bottom of that same page).
>>>
>>> My code is:
>>> <?
>>> session_register();
>>> session_start();
>>> $url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
>>> $xml = simplexml_load_file($url);
>>>
>>> echo '<b>Santa Barbara weather:</b><br />';
>>> echo $xml->weather, '<br />';
>>> echo $xml->temperature_string, '<br />';
>>> echo $xml->relative_humidity, '% humidity<br />';
>>> ?>
>>>
>>> and the impaired results are on a test page at:
>>>
>>> http://www.geol.ucsb.edu/library/php/weather.php
>>>
>>> Can anybody point me in the right direction? I'm essentially a
>>> newbie.
>>> Thanks!
>>
>> The code works for me.
>>
>>
> On Firefox 3.17 I get
> ----------------------
> Santa Barbara weather:
>
>
> % humidity
> --------------------
> which is not the desired result
>
> bill

On the same version of firefox I get:

Santa Barbara weather:
Fog/Mist
55.0 F (12.8 C)
90% humidity

Which is the desired result.  But the browser has absolutely nothing to 
do with it.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#1460

Frombill <nobody@spamcop.net>
Date2011-05-07 07:28 -0400
Message-ID<5uWdnXMptq9BsVjQnZ2dnUVZ_sgAAAAA@cablespeedmi.com>
In reply to#1457
On 5/7/2011 7:17 AM, Jerry Stuckle wrote:
> On 5/7/2011 6:07 AM, bill wrote:
>> On 5/6/2011 9:23 PM, Jerry Stuckle wrote:
>>> On 5/6/2011 6:22 PM, Evolution wrote:
>>>> On phpbuilder.com, I found the following:
>>>>
>>>> http://www.phpbuilder.com/board/showthread.php?t=10283087
>>>>
>>>> which discusses how to obtain the current weather for a feed
>>>> closest
>>>> to you.
>>>>
>>>> I modified the code to my site but didn't get the same
>>>> results as
>>>> shown by Kudose (a poster at the bottom of that same page).
>>>>
>>>> My code is:
>>>> <?
>>>> session_register();
>>>> session_start();
>>>> $url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
>>>> $xml = simplexml_load_file($url);
>>>>
>>>> echo '<b>Santa Barbara weather:</b><br />';
>>>> echo $xml->weather, '<br />';
>>>> echo $xml->temperature_string, '<br />';
>>>> echo $xml->relative_humidity, '% humidity<br />';
>>>> ?>
>>>>
>>>> and the impaired results are on a test page at:
>>>>
>>>> http://www.geol.ucsb.edu/library/php/weather.php
>>>>
>>>> Can anybody point me in the right direction? I'm essentially a
>>>> newbie.
>>>> Thanks!
>>>
>>> The code works for me.
>>>
>>>
>> On Firefox 3.17 I get
>> ----------------------
>> Santa Barbara weather:
>>
>>
>> % humidity
>> --------------------
>> which is not the desired result
>>
>> bill
>
> On the same version of firefox I get:
>
> Santa Barbara weather:
> Fog/Mist
> 55.0 F (12.8 C)
> 90% humidity
>
> Which is the desired result. But the browser has absolutely
> nothing to do with it.

Indeed, I just included it for completeness.

So, why does it fail sometimes ?
bill

[toc] | [prev] | [next] | [standalone]


#1462

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-05-07 07:40 -0400
Message-ID<iq3b2p$cn8$2@dont-email.me>
In reply to#1460
On 5/7/2011 7:28 AM, bill wrote:
> On 5/7/2011 7:17 AM, Jerry Stuckle wrote:
>> On 5/7/2011 6:07 AM, bill wrote:
>>> On 5/6/2011 9:23 PM, Jerry Stuckle wrote:
>>>> On 5/6/2011 6:22 PM, Evolution wrote:
>>>>> On phpbuilder.com, I found the following:
>>>>>
>>>>> http://www.phpbuilder.com/board/showthread.php?t=10283087
>>>>>
>>>>> which discusses how to obtain the current weather for a feed
>>>>> closest
>>>>> to you.
>>>>>
>>>>> I modified the code to my site but didn't get the same
>>>>> results as
>>>>> shown by Kudose (a poster at the bottom of that same page).
>>>>>
>>>>> My code is:
>>>>> <?
>>>>> session_register();
>>>>> session_start();
>>>>> $url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
>>>>> $xml = simplexml_load_file($url);
>>>>>
>>>>> echo '<b>Santa Barbara weather:</b><br />';
>>>>> echo $xml->weather, '<br />';
>>>>> echo $xml->temperature_string, '<br />';
>>>>> echo $xml->relative_humidity, '% humidity<br />';
>>>>> ?>
>>>>>
>>>>> and the impaired results are on a test page at:
>>>>>
>>>>> http://www.geol.ucsb.edu/library/php/weather.php
>>>>>
>>>>> Can anybody point me in the right direction? I'm essentially a
>>>>> newbie.
>>>>> Thanks!
>>>>
>>>> The code works for me.
>>>>
>>>>
>>> On Firefox 3.17 I get
>>> ----------------------
>>> Santa Barbara weather:
>>>
>>>
>>> % humidity
>>> --------------------
>>> which is not the desired result
>>>
>>> bill
>>
>> On the same version of firefox I get:
>>
>> Santa Barbara weather:
>> Fog/Mist
>> 55.0 F (12.8 C)
>> 90% humidity
>>
>> Which is the desired result. But the browser has absolutely
>> nothing to do with it.
>
> Indeed, I just included it for completeness.
>
> So, why does it fail sometimes ?
> bill
>

There can be a number of possibilities, most of which have to do with 
his setup.  The op needs to do further debugging - see my other post.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#1456

FromEvolution <cryptozoan@gmail.com>
Date2011-05-07 03:21 -0700
Message-ID<1cb02e5c-7342-4176-9049-bd5ddcbafb5d@l2g2000prg.googlegroups.com>
In reply to#1450
On May 6, 6:23 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 5/6/2011 6:22 PM, Evolution wrote:
>
>
>
>
>
> > On phpbuilder.com,  I found the following:
>
> >    http://www.phpbuilder.com/board/showthread.php?t=10283087
>
> > which discusses how to obtain the current weather for a feed closest
> > to you.
>
> > I modified the code to my site but didn't get the same results as
> > shown by Kudose (a poster at the bottom of that same page).
>
> > My code is:
> > <?
> > session_register();
> > session_start();
> > $url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
> > $xml = simplexml_load_file($url);
>
> > echo '<b>Santa Barbara weather:</b><br />';
> > echo $xml->weather, '<br />';
> > echo $xml->temperature_string, '<br />';
> > echo $xml->relative_humidity, '% humidity<br />';
> > ?>
>
> > and the impaired results are on a test page at:
>
> >    http://www.geol.ucsb.edu/library/php/weather.php
>
> > Can anybody point me in the right direction?  I'm essentially a
> > newbie.
> > Thanks!
>
> The code works for me.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

Wow!  What could make this possible if I am using PHP5 and my browser
fails but yours doesn't?

[toc] | [prev] | [next] | [standalone]


#1458

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-05-07 07:23 -0400
Message-ID<iq3a31$4ui$1@dont-email.me>
In reply to#1456
On 5/7/2011 6:21 AM, Evolution wrote:
> On May 6, 6:23 pm, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
>> On 5/6/2011 6:22 PM, Evolution wrote:
>>
>>
>>
>>
>>
>>> On phpbuilder.com,  I found the following:
>>
>>>     http://www.phpbuilder.com/board/showthread.php?t=10283087
>>
>>> which discusses how to obtain the current weather for a feed closest
>>> to you.
>>
>>> I modified the code to my site but didn't get the same results as
>>> shown by Kudose (a poster at the bottom of that same page).
>>
>>> My code is:
>>> <?
>>> session_register();
>>> session_start();
>>> $url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
>>> $xml = simplexml_load_file($url);
>>
>>> echo '<b>Santa Barbara weather:</b><br />';
>>> echo $xml->weather, '<br />';
>>> echo $xml->temperature_string, '<br />';
>>> echo $xml->relative_humidity, '% humidity<br />';
>>> ?>
>>
>>> and the impaired results are on a test page at:
>>
>>>     http://www.geol.ucsb.edu/library/php/weather.php
>>
>>> Can anybody point me in the right direction?  I'm essentially a
>>> newbie.
>>> Thanks!
>>
>> The code works for me.
>>
>
> Wow!  What could make this possible if I am using PHP5 and my browser
> fails but yours doesn't?

There are several possibilities.  For instance, do you have a firewall 
blocking access?  Is allow_url_fopen() disabled?  Or any of several things.

You need to do some debugging.  First thing is to ensure they php.ini 
file on your development system has:

display_errors=on
error_reporting=E_ALL  // or E_ALL | E_STRICT

And see what kind of error messages you are getting.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#1473

FromEvolution <cryptozoan@gmail.com>
Date2011-05-08 00:07 -0700
Message-ID<39be3aa9-bf3b-4c65-a235-7a3a994a2fe8@d19g2000prh.googlegroups.com>
In reply to#1458
On May 7, 4:23 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 5/7/2011 6:21 AM, Evolution wrote:
>
>
>
>
>
> > On May 6, 6:23 pm, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
> >> On 5/6/2011 6:22 PM, Evolution wrote:
>
> >>> On phpbuilder.com,  I found the following:
>
> >>>    http://www.phpbuilder.com/board/showthread.php?t=10283087
>
> >>> which discusses how to obtain the current weather for a feed closest
> >>> to you.
>
> >>> I modified the code to my site but didn't get the same results as
> >>> shown by Kudose (a poster at the bottom of that same page).
>
> >>> My code is:
> >>> <?
> >>> session_register();
> >>> session_start();
> >>> $url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
> >>> $xml = simplexml_load_file($url);
>
> >>> echo '<b>Santa Barbara weather:</b><br />';
> >>> echo $xml->weather, '<br />';
> >>> echo $xml->temperature_string, '<br />';
> >>> echo $xml->relative_humidity, '% humidity<br />';
> >>> ?>
>
> >>> and the impaired results are on a test page at:
>
> >>>    http://www.geol.ucsb.edu/library/php/weather.php
>
> >>> Can anybody point me in the right direction?  I'm essentially a
> >>> newbie.
> >>> Thanks!
>
> >> The code works for me.
>
> > Wow!  What could make this possible if I am using PHP5 and my browser
> > fails but yours doesn't?
>
> There are several possibilities.  For instance, do you have a firewall
> blocking access?  Is allow_url_fopen() disabled?  Or any of several things.
>
> You need to do some debugging.  First thing is to ensure they php.ini
> file on your development system has:
>
> display_errors=on
> error_reporting=E_ALL  // or E_ALL | E_STRICT
>
> And see what kind of error messages you are getting.

According to phpinfo(), allow_url_fopen is off.  Although I maintain
websites in my department as a network admin, I do not manage this
particular site because, due to lack of staff, the Department gave the
responsibility of it to the college several years back.  Is there some
security risk that would make them keep it off?

Also, as you can imagine, I have no shell access to this system
(except indirectly by mounting the directory tree via smb) and,
according to phpinfo(), the php.ini file is located in the /etc/php/
apache2-php5/ directory.  Thus, I am unable to even view the php.ini
file.

I still cannot fathom though why a remote client (yours) would be able
to view the results but not a local client (mine).  Why would the
server say no to me but not to you which, inherently, is less secure?
It's not that I doubt you -- I'm just trying to understand what's
happening here.



> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

[toc] | [prev] | [next] | [standalone]


#1475

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-05-08 08:11 -0400
Message-ID<iq61a7$ml$1@dont-email.me>
In reply to#1473
On 5/8/2011 3:07 AM, Evolution wrote:
> On May 7, 4:23 am, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
>> On 5/7/2011 6:21 AM, Evolution wrote:
>>
>>
>>
>>
>>
>>> On May 6, 6:23 pm, Jerry Stuckle<jstuck...@attglobal.net>    wrote:
>>>> On 5/6/2011 6:22 PM, Evolution wrote:
>>
>>>>> On phpbuilder.com,  I found the following:
>>
>>>>>     http://www.phpbuilder.com/board/showthread.php?t=10283087
>>
>>>>> which discusses how to obtain the current weather for a feed closest
>>>>> to you.
>>
>>>>> I modified the code to my site but didn't get the same results as
>>>>> shown by Kudose (a poster at the bottom of that same page).
>>
>>>>> My code is:
>>>>> <?
>>>>> session_register();
>>>>> session_start();
>>>>> $url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
>>>>> $xml = simplexml_load_file($url);
>>
>>>>> echo '<b>Santa Barbara weather:</b><br />';
>>>>> echo $xml->weather, '<br />';
>>>>> echo $xml->temperature_string, '<br />';
>>>>> echo $xml->relative_humidity, '% humidity<br />';
>>>>> ?>
>>
>>>>> and the impaired results are on a test page at:
>>
>>>>>     http://www.geol.ucsb.edu/library/php/weather.php
>>
>>>>> Can anybody point me in the right direction?  I'm essentially a
>>>>> newbie.
>>>>> Thanks!
>>
>>>> The code works for me.
>>
>>> Wow!  What could make this possible if I am using PHP5 and my browser
>>> fails but yours doesn't?
>>
>> There are several possibilities.  For instance, do you have a firewall
>> blocking access?  Is allow_url_fopen() disabled?  Or any of several things.
>>
>> You need to do some debugging.  First thing is to ensure they php.ini
>> file on your development system has:
>>
>> display_errors=on
>> error_reporting=E_ALL  // or E_ALL | E_STRICT
>>
>> And see what kind of error messages you are getting.
>
> According to phpinfo(), allow_url_fopen is off.  Although I maintain
> websites in my department as a network admin, I do not manage this
> particular site because, due to lack of staff, the Department gave the
> responsibility of it to the college several years back.  Is there some
> security risk that would make them keep it off?
>

It all depends on the security policies of your college and how the 
server is being used.

> Also, as you can imagine, I have no shell access to this system
> (except indirectly by mounting the directory tree via smb) and,
> according to phpinfo(), the php.ini file is located in the /etc/php/
> apache2-php5/ directory.  Thus, I am unable to even view the php.ini
> file.
>

phpinfo() can tell you pretty much everything you need to know.

> I still cannot fathom though why a remote client (yours) would be able
> to view the results but not a local client (mine).  Why would the
> server say no to me but not to you which, inherently, is less secure?
> It's not that I doubt you -- I'm just trying to understand what's
> happening here.
>

Because I'm running the code from my own server, not yours.  And I have 
allow_url_fopen() enabled.



-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#1477

FromEvolution <cryptozoan@gmail.com>
Date2011-05-08 16:29 -0700
Message-ID<f9d8e963-31da-4eed-bf2b-1e7c5f01b15d@z13g2000prk.googlegroups.com>
In reply to#1475
On May 8, 5:11 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 5/8/2011 3:07 AM, Evolution wrote:
>
>
>
>
>
> > On May 7, 4:23 am, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
> >> On 5/7/2011 6:21 AM, Evolution wrote:
>
> >>> On May 6, 6:23 pm, Jerry Stuckle<jstuck...@attglobal.net>    wrote:
> >>>> On 5/6/2011 6:22 PM, Evolution wrote:
>
> >>>>> On phpbuilder.com,  I found the following:
>
> >>>>>    http://www.phpbuilder.com/board/showthread.php?t=10283087
>
> >>>>> which discusses how to obtain the current weather for a feed closest
> >>>>> to you.
>
> >>>>> I modified the code to my site but didn't get the same results as
> >>>>> shown by Kudose (a poster at the bottom of that same page).
>
> >>>>> My code is:
> >>>>> <?
> >>>>> session_register();
> >>>>> session_start();
> >>>>> $url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
> >>>>> $xml = simplexml_load_file($url);
>
> >>>>> echo '<b>Santa Barbara weather:</b><br />';
> >>>>> echo $xml->weather, '<br />';
> >>>>> echo $xml->temperature_string, '<br />';
> >>>>> echo $xml->relative_humidity, '% humidity<br />';
> >>>>> ?>
>
> >>>>> and the impaired results are on a test page at:
>
> >>>>>    http://www.geol.ucsb.edu/library/php/weather.php
>
> >>>>> Can anybody point me in the right direction?  I'm essentially a
> >>>>> newbie.
> >>>>> Thanks!
>
> >>>> The code works for me.
>
> >>> Wow!  What could make this possible if I am using PHP5 and my browser
> >>> fails but yours doesn't?
>
> >> There are several possibilities.  For instance, do you have a firewall
> >> blocking access?  Is allow_url_fopen() disabled?  Or any of several things.
>
> >> You need to do some debugging.  First thing is to ensure they php.ini
> >> file on your development system has:
>
> >> display_errors=on
> >> error_reporting=E_ALL  // or E_ALL | E_STRICT
>
> >> And see what kind of error messages you are getting.
>
> > According to phpinfo(), allow_url_fopen is off.  Although I maintain
> > websites in my department as a network admin, I do not manage this
> > particular site because, due to lack of staff, the Department gave the
> > responsibility of it to the college several years back.  Is there some
> > security risk that would make them keep it off?
>
> It all depends on the security policies of your college and how the
> server is being used.
>
> > Also, as you can imagine, I have no shell access to this system
> > (except indirectly by mounting the directory tree via smb) and,
> > according to phpinfo(), the php.ini file is located in the /etc/php/
> > apache2-php5/ directory.  Thus, I am unable to even view the php.ini
> > file.
>
> phpinfo() can tell you pretty much everything you need to know.
>
> > I still cannot fathom though why a remote client (yours) would be able
> > to view the results but not a local client (mine).  Why would the
> > server say no to me but not to you which, inherently, is less secure?
> > It's not that I doubt you -- I'm just trying to understand what's
> > happening here.
>
> Because I'm running the code from my own server, not yours.  And I have
> allow_url_fopen() enabled.

I guess I should have realized that.  I just thought you were clicking
on the URL I posted. :)  Thanks a bunch for your help.  Any idea as to
why they would have "allow_url_fopen()" off?


> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

[toc] | [prev] | [next] | [standalone]


#1478

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-05-08 21:53 -0400
Message-ID<iq7hef$p9b$1@dont-email.me>
In reply to#1477
On 5/8/2011 7:29 PM, Evolution wrote:
> On May 8, 5:11 am, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
>> On 5/8/2011 3:07 AM, Evolution wrote:
>>
>>
>>
>>
>>
>>> On May 7, 4:23 am, Jerry Stuckle<jstuck...@attglobal.net>    wrote:
>>>> On 5/7/2011 6:21 AM, Evolution wrote:
>>
>>>>> On May 6, 6:23 pm, Jerry Stuckle<jstuck...@attglobal.net>      wrote:
>>>>>> On 5/6/2011 6:22 PM, Evolution wrote:
>>
>>>>>>> On phpbuilder.com,  I found the following:
>>
>>>>>>>     http://www.phpbuilder.com/board/showthread.php?t=10283087
>>
>>>>>>> which discusses how to obtain the current weather for a feed closest
>>>>>>> to you.
>>
>>>>>>> I modified the code to my site but didn't get the same results as
>>>>>>> shown by Kudose (a poster at the bottom of that same page).
>>
>>>>>>> My code is:
>>>>>>> <?
>>>>>>> session_register();
>>>>>>> session_start();
>>>>>>> $url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
>>>>>>> $xml = simplexml_load_file($url);
>>
>>>>>>> echo '<b>Santa Barbara weather:</b><br />';
>>>>>>> echo $xml->weather, '<br />';
>>>>>>> echo $xml->temperature_string, '<br />';
>>>>>>> echo $xml->relative_humidity, '% humidity<br />';
>>>>>>> ?>
>>
>>>>>>> and the impaired results are on a test page at:
>>
>>>>>>>     http://www.geol.ucsb.edu/library/php/weather.php
>>
>>>>>>> Can anybody point me in the right direction?  I'm essentially a
>>>>>>> newbie.
>>>>>>> Thanks!
>>
>>>>>> The code works for me.
>>
>>>>> Wow!  What could make this possible if I am using PHP5 and my browser
>>>>> fails but yours doesn't?
>>
>>>> There are several possibilities.  For instance, do you have a firewall
>>>> blocking access?  Is allow_url_fopen() disabled?  Or any of several things.
>>
>>>> You need to do some debugging.  First thing is to ensure they php.ini
>>>> file on your development system has:
>>
>>>> display_errors=on
>>>> error_reporting=E_ALL  // or E_ALL | E_STRICT
>>
>>>> And see what kind of error messages you are getting.
>>
>>> According to phpinfo(), allow_url_fopen is off.  Although I maintain
>>> websites in my department as a network admin, I do not manage this
>>> particular site because, due to lack of staff, the Department gave the
>>> responsibility of it to the college several years back.  Is there some
>>> security risk that would make them keep it off?
>>
>> It all depends on the security policies of your college and how the
>> server is being used.
>>
>>> Also, as you can imagine, I have no shell access to this system
>>> (except indirectly by mounting the directory tree via smb) and,
>>> according to phpinfo(), the php.ini file is located in the /etc/php/
>>> apache2-php5/ directory.  Thus, I am unable to even view the php.ini
>>> file.
>>
>> phpinfo() can tell you pretty much everything you need to know.
>>
>>> I still cannot fathom though why a remote client (yours) would be able
>>> to view the results but not a local client (mine).  Why would the
>>> server say no to me but not to you which, inherently, is less secure?
>>> It's not that I doubt you -- I'm just trying to understand what's
>>> happening here.
>>
>> Because I'm running the code from my own server, not yours.  And I have
>> allow_url_fopen() enabled.
>
> I guess I should have realized that.  I just thought you were clicking
> on the URL I posted. :)  Thanks a bunch for your help.  Any idea as to
> why they would have "allow_url_fopen()" off?
>
>
No, I can't see the code if it's on your server, and I have no control 
over your environment.  So it really does no good for me to try to test 
the code on your server; besides, I'll only get the same result you do.

As for why - you'll have to ask the people running your server.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#1451

FromMacRoks <macroks@aim.com>
Date2011-05-06 22:24 -0400
Message-ID<2011050622243721017-macroks@aimcom>
In reply to#1448
On 2011-05-06 18:22:33 -0400, Evolution said:

> On phpbuilder.com,  I found the following:
> 
>    http://www.phpbuilder.com/board/showthread.php?t=10283087
> 
> which discusses how to obtain the current weather for a feed closest
> to you.
> 
> I modified the code to my site but didn't get the same results as
> shown by Kudose (a poster at the bottom of that same page).
> 
> My code is:
> <?
> session_register();
> session_start();
> $url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
> $xml = simplexml_load_file($url);
> 
> echo '<b>Santa Barbara weather: </b><br />';
> echo $xml->weather, '<br />';
> echo $xml->temperature_string, '<br />';
> echo $xml->relative_humidity, '% humidity <br />';
> ?>
> 
> and the impaired results are on a test page at:
> 
>    http://www.geol.ucsb.edu/library/php/weather.php
> 
> Can anybody point me in the right direction?  I'm essentially a
> newbie.
> Thanks!

What version of PHP do you have?
-- 
MacRoks
---------------------------
Kindle 3 Wifi+3G
MacBook
iPod Touch 3G 64 GB
HP Palm Pre

[toc] | [prev] | [next] | [standalone]


#1455

FromEvolution <cryptozoan@gmail.com>
Date2011-05-07 03:17 -0700
Message-ID<d59e2a5d-3075-4686-8efc-391a8bb4bbba@h36g2000pro.googlegroups.com>
In reply to#1451
On May 6, 7:24 pm, MacRoks <macr...@aim.com> wrote:
> On 2011-05-06 18:22:33 -0400, Evolution said:
>
>
>
>
>
> > On phpbuilder.com,  I found the following:
>
> >    http://www.phpbuilder.com/board/showthread.php?t=10283087
>
> > which discusses how to obtain the current weather for a feed closest
> > to you.
>
> > I modified the code to my site but didn't get the same results as
> > shown by Kudose (a poster at the bottom of that same page).
>
> > My code is:
> > <?
> > session_register();
> > session_start();
> > $url = 'http://www.nws.noaa.gov/data/current_obs/KSBA.xml';
> > $xml = simplexml_load_file($url);
>
> > echo '<b>Santa Barbara weather: </b><br />';
> > echo $xml->weather, '<br />';
> > echo $xml->temperature_string, '<br />';
> > echo $xml->relative_humidity, '% humidity <br />';
> > ?>
>
> > and the impaired results are on a test page at:
>
> >    http://www.geol.ucsb.edu/library/php/weather.php
>
> > Can anybody point me in the right direction?  I'm essentially a
> > newbie.
> > Thanks!
>
> What version of PHP do you have?

5.2.12-pl0-gentoo

> --
> MacRoks
> ---------------------------
> Kindle 3 Wifi+3G
> MacBook
> iPod Touch 3G 64 GB
> HP Palm Pre

[toc] | [prev] | [next] | [standalone]


#1472

FromMacRoks <macroks@aim.com>
Date2011-05-07 20:39 -0400
Message-ID<2011050720391189573-macroks@aimcom>
In reply to#1455
>> 
>> What version of PHP do you have?
> 
> 5.2.12-pl0-gentoo

Hm.... Then your version of PHP isn't the problem. e.g. 4.2 would 
definitely not work. Did you try copying and pasting the code? Try 
debugging using stoppers and printers.
-- 
MacRoks
---------------------------
Kindle 3 Wifi+3G
MacBook
iPod Touch 3G 64 GB
HP Palm Pre

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web