Jump to content

[SOLVED] Weather.com XML Data Feed


ldsmike88

Recommended Posts

I have a really old script I have been using for weather from weather.com. It get's the weather and shows it on my homepage. A few weeks ago it randomly stopped working. I renewed my account with weather.com and I still can't get it to work. It seems to be getting stuck on the line of code below. If anyone knows what the problem with this is, or if you know of a good sample script for a weather.com xml feed I would greatly appreciate it! Thanks!

 

// Get XML Query Results from Weather.com
$fp = fopen($url,"r");
while(!feof($fp)){
$xml .= fgets($fp, 4096);
}

Link to comment
https://forums.phpfreaks.com/topic/41570-solved-weathercom-xml-data-feed/
Share on other sites

Well I thought I turned on fopen. In the php.ini file I simply edited the file and uploaded it to the server. I changed it to this:

 

;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
allow_url_include = On

 

But when I run phpinfo(); it says

allow_url_fopen Off

allow_url_include Off

 

Why doesn't it turn it on? Thanks!

 

Michael

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.