FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » getting only the temperature & general weather condition
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: getting only the temperature & general weather condition [message #173828 is a reply to message #173826] Sat, 07 May 2011 11:40 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
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(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: evaluating a null value in an array
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 15:30:47 GMT 2024

Total time taken to generate the page: 0.04769 seconds