I discovered I’d left out a ‘:’ in one expression, so a return to point-printable from failover zone forecast wouldn’t happen if the text of the forecast contained the word ‘location’.
Change
if (preg_match('/Temporary|Location/Uis',$html)) {
to
if (preg_match('/Temporary|Location:/Uis',$html)) {
Hello All: I have been using the forecast page for some time. Today, for some reason, the forecase page was not displaying…just the link to force the page to update. When you clicked on the force update there was no change. When I saw this post I decided to correct the code.
I copied the script from the link above and made the necessary changes for my area. Once changes were complete I uploaded the php file to the same location as before. When I call up my page the PHP code is displayed. I’m not quite sure what I did wrong…
This is what I’m using to call the script into my forecast page:
It will center the forecast with Icons page, and also add dark background…Most like it centered on their page, but not all add the dark background effect.it’s your choice.
My forecast is there, I can put that URL in a browser and it comes up. When I open my web page, the script does not use that forecast, and I can’t figure out why. It isn’t a cache issue, because I replaced the cache with a blank page and it still did not not use the forecast I have listed. It wouldn’t matter so much, but I saw today that it is screwed up.
I’m having the same problem. It appears only the Zone is coming up even though the url for mytown is working. I added the : in both places. What am I missing?
It looks like your ‘forecast.txt’ script is not being overwritten … use your IIS control panel to set the permissions for allow read/write to that file and your forecast should work ok.
<b>Warning</b>: readfile(c:\inetpub\wwwroot) [<a href='function.readfile'>function.readfile</a>]: failed to open stream: Permission denied in <b>C:\Inetpub\wwwroot\extendedforecast2.php</b> on line <b>90</b>
Hmmm. Now your forecast.txt file has a Carter Lake, IA forecast from Feb, 2007 – I don’t think the script can write your forecast.txt file yet. Would you mind sending me the source for your advforecast2.php file so I can take a look ( webmaster [at] saratoga-weather.org ).
You are ahead of the game, yet again! I was going to try and write something for the temporary file stuff but you have already done it. I will have to review your code to see how it’s done.
Thanks for all your contributions to this board!
Jeff
I’m still working out the fact I can’t get anything to write to the forecast.txt file. IIS permissions to the file seem correct. going to try some test php to write a simple text to the file.
to the start of the script and see what it says. Also, your php.ini may have a setting that prevents writing local files – like Safe_mode = on , but I think it’s still the permissions.