Author Topic: Ajax Website Not Updating  (Read 17586 times)

0 Members and 1 Guest are viewing this topic.

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Ajax Website Not Updating
« on: December 14, 2007, 01:04:19 PM »
Hi gang;

Take a look at my website.  www.bigbaywx.com  For some reason it's not updating at all since 12/14  0040Hrs.  It's been running pretty flawlessly but when I woke up this morning I took a look and found out it's no longer updating.  That happened once before and it was a clientraw problem.  So like before I just deleted the clientraw from both the website public_html folder and also from the weather display folder and simply recreated the file, uploaded it and last time that fixed the problem and this time still no updating.

I went through everything on weather display including swapping the backup files into the weather display webfiles folder thinking that a file had gotten corrupted and then re-uploaded all the files to the website and it still won't update.  Then I did a complete uninstall of weather display, cleaned out all the old registry files and reinstalled weather display, re-uploaded the files to the website and no update.  The only thing updating on the webpage is the radar display.  Everything else from the forecast, weather advisories, daily stats and graphs, ect are not updating.  I think the problem is on my end but I even did a restore on the website to a previously saved configuration in case a file was corrupted on the website and still no joy.

I have done everything I can think of short of totally deleting everthing I have done so far on my end and then going into the website and deleting everything and trying to start all over.  Any of you guru's have any idea whatsoever that I can try??

Offline carterlake

  • Senior Contributor
  • ****
  • Posts: 243
    • CarterLake.org
Re: Ajax Website Not Updating
« Reply #1 on: December 14, 2007, 02:02:11 PM »
Hi gang;

Take a look at my website.  www.bigbaywx.com  For some reason it's not updating at all since 12/14  0040Hrs.  It's been running pretty flawlessly but when I woke up this morning I took a look and found out it's no longer updating.  That happened once before and it was a clientraw problem.  So like before I just deleted the clientraw from both the website public_html folder and also from the weather display folder and simply recreated the file, uploaded it and last time that fixed the problem and this time still no updating.

I went through everything on weather display including swapping the backup files into the weather display webfiles folder thinking that a file had gotten corrupted and then re-uploaded all the files to the website and it still won't update.  Then I did a complete uninstall of weather display, cleaned out all the old registry files and reinstalled weather display, re-uploaded the files to the website and no update.  The only thing updating on the webpage is the radar display.  Everything else from the forecast, weather advisories, daily stats and graphs, ect are not updating.  I think the problem is on my end but I even did a restore on the website to a previously saved configuration in case a file was corrupted on the website and still no joy.

I have done everything I can think of short of totally deleting everthing I have done so far on my end and then going into the website and deleting everything and trying to start all over.  Any of you guru's have any idea whatsoever that I can try??

Holy cow! I sure wouldn't have done all that first!

Do you have "rename" the clientraw setup in WD?

Do you have to auto restarting every X minutes?

Mine would crap out every once and while so I set it up to auto restart itself every 30 minutes... fixed the problem.

Davis VP2 6153; Weather Display (LIVE w/ Ajax); Quickcam for Notebooks Pro; Boltek w/ Nexstorm; GRLevel3; live NOAA Radio

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Senior Contributor
  • ****
  • Posts: 193
  • Davis Vantage Pro2+ with full FARS
Re: Ajax Website Not Updating
« Reply #2 on: December 14, 2007, 02:03:45 PM »
This is not really an Ajax issue as all it is doing it looking for the data in the clientraw.txt files.

Looking at what it commonly the place to look for those files, I find the clientraw.txt file with the date you are reporting...one of several places...


029   Hour   T   00
030   Minute   T   40
031   Seconds   T   55
032   Station Name   L   -12:40:55 AM

035   Day   T   14
036   Month   T   12


So the issue breaks down to one of several possibilities...

1) WD is not updating the data in the clientraw files but is uploading the file that was last updated.
2) WD is updating the clientraw files but not uploading them to your web server.

It is hard to tell which of the two is happening without seeing the date stamp of the actual file on the webserver.  IF it is current, then the issue is #1.  If it is not current, it could be issue #2.

There are a number of possible causes for both, so you first need to figure out which is the issue.
All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax Website Not Updating
« Reply #3 on: December 14, 2007, 02:05:41 PM »
Would you mind posting a bit of the log from your realtimeclientrawftp program?  You can doubleclick on the yellow icon in the system task area to restore the window for the process.  Hit Stop to pause the updates, then copy a couple of screens worth of log to the clipboard and paste them on a reply here.  That will help us to see what (if any) FTP issues there are.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #4 on: December 14, 2007, 03:07:28 PM »
I'm at work right now and won't be able to do anything until I get home which will be around 11:30pm eastern. 

@Saratoga
I have not used the clientraw real time ftp program as it was updating every minute and was too resource intensive.  I had it set up in the internet files section, had the file created and uploaded every 5 minutes and that was working fine.  I was watching the files in the ftp program update every 5 minutes and it was sending the clientraw the other clientraw annexes up to the website.  It's also sending the locals up as well as it should be doing.  Don't see it doing any different.  If I should use the real time clientraw I'll turn that on when I get home and watch it and upload some of the status files.

@tnet
My guess out of the two would be that WD isn't updating the clientraw but I'll check that against the datestamps when I get home.  I can get into the website control panel from work so if there is any information in the files menu that would be helpful I can post that.

@carter
Quote
Do you have "rename" the clientraw setup in WD?

Do you have to auto restarting every X minutes?

I don't even remember a rename box being in the clientraw set up.  I'll check that out when I get home.  However not sure what you mean about the "auto restarting".  Unless your referring as too how often the updates are sent??  It's set up to upload the clientraw every 5 minutes at this point.  You may have to enlighten me on the auto restart.

@Everyone,

I do appreciate the helpful suggestions and I'll look at some of these things when I get home.  The thing that gets me is it was working fine and just crapped out early this morning for some strange reason.  I'm still sort of a noob at this so just going through the growing pains.

Thanks again!!
« Last Edit: December 14, 2007, 03:09:55 PM by Hfcomms »

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #5 on: December 14, 2007, 08:31:31 PM »
Hmmm....

I noticed that my host has a php5 conversion going on with all it's servers and apparently mine was updated within the last 24 hours which is when I started having my problems.  I came accross this on one of their help boards.


Question
Quote
Originally Posted by varaonaid View Post
what are the "changes" that will be required to be made once the php5 conversion is complete?

Answer

Quote
Two possible changes (not necessarily required) for PHP5:

(1) Add the following line to the .htaccess file:
php_flag register_globals on

PHP4 had register_globals on by default, and PHP5 has it off by default. If your script breaks after the upgrade to PHP5 -- it did for one of my clients -- try turning register_globals back on via the .htaccess file. Or better yet, rewrite the script so it doesn't need register_globals.

(2) If you receive the following error message:
"URL file-access is disabled in the server configuration"

it means your script uses URL file-access (allow_url_fopen to On) (include fopen). That worked in PHP4 but not in PHP5 -- again because it's a security risk. You'll need to rewrite the script.

Could #1 have any bearing on my little situation here or is the conversion just a coincidence??

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Senior Contributor
  • ****
  • Posts: 193
  • Davis Vantage Pro2+ with full FARS
Re: Ajax Website Not Updating
« Reply #6 on: December 14, 2007, 08:46:12 PM »

You SHOULD NOT have any script that requires register globals on. I'm very surprised they stated that... as that is a big security issue...  No site should have Register Globals on at all.

# 2 would effect you if you are doing any number of dynamic scripts that fetch data from remote sources (like forecasts, NWS RSS etc... )

For clientraw.txt  neither should be effecting that.

Several have suggested that you look at your logs to see what is actually going on.

Quote
Would you mind posting a bit of the log from your realtimeclientrawftp program?
All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #7 on: December 14, 2007, 09:40:14 PM »
Thanks Kevin,

Glad to see that won't be an issue.  Just an interesting coincidence that the server was upgrading around the time the website pooped out.

Quote
Several have suggested that you look at your logs to see what is actually going on.

Yep, I realize that and I will.  But I've been at work all evening and won't be home for a few more hours so nothing I can do at the moment.  When I get home or tomorrow morning I'll see what the logs are saying and maybe someone can point me in the right direction.

Thanks Again!!

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax Website Not Updating
« Reply #8 on: December 14, 2007, 11:06:33 PM »
Quote
(2) If you receive the following error message:
"URL file-access is disabled in the server configuration"

it means your script uses URL file-access (allow_url_fopen to On) (include fopen). That worked in PHP4 but not in PHP5 -- again because it's a security risk. You'll need to rewrite the script.
is really a not a security risk except to poorly written PHP that would allow arbitrary URLs to be fetched (none of the scripts I'm aware of for weather PHP are vulnerable to this exploit).  By default in PHP5, the setting for allow_url_fopen is set to OFF (denying the function). 

Less knee-jerk hosters realize that the same function of fopen() with an URL is available with fconnect/fget (that is, read contents of an URL into an array for processing), so closing one and not the other makes no sense.
Closing both denies a great deal of functionality to PHP and should be grounds to seek a more enlightened hoster for your website. 

I agree with Kevin about register_globals... bad news, and it's good to have that one closed. Your script issue was caused by disallowing fopen() to access URLs.

Have you tried the override in a php.ini in your document root of your website saying
Code: [Select]
allow_url_fopen = on;
allow_url_include = on;


Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Senior Contributor
  • ****
  • Posts: 193
  • Davis Vantage Pro2+ with full FARS
Re: Ajax Website Not Updating
« Reply #9 on: December 14, 2007, 11:36:08 PM »
I personally have not run into this yet so I really don't know the answer, but my understanding was that using fopen to access URL's (allow_url_fopen) is blocked in the newer PHP5 versions, but that fopen for a local file was not.

If that is the case, why is he having problems with this. The clientraw file he is accessing should be local, not a URL... right?

BTW... as of earlier this evening, he had no clientraw.txt file when I checked... still doesn't now.
All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax Website Not Updating
« Reply #10 on: December 14, 2007, 11:42:17 PM »
 :oops: :roll: Sorry Kevin, I'd lost touch with the topic of the thread which was why clientraw was not updating and got off on a tangent about PHP5/allow_url_fopen restriction being not so bright as claimed.

Apologies!!

Back to the normal jist of the thread.. if he doesn't have a clientraw.txt on his site, that's the problem to fix and it has nothing to do with PHP.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #11 on: December 15, 2007, 12:31:39 AM »
Clientraw text is on the site and is updating normally.

Quote
*******list of files uploaded********
Uploading C:\Program Files\wdisplay\webfiles\wx.html -> index.html

Uploading C:\Program Files\wdisplay\webfiles\wx3.html -> wx3.html
Uploading C:\Program Files\wdisplay\webfiles\wx5.html -> wx5.html
Uploading C:\Program Files\wdisplay\webfiles\clientraw.txt -> clientraw.txt
Uploading C:\Program Files\wdisplay\webfiles\clientrawextra.txt -> clientrawextra.txt
Uploading C:\Program Files\wdisplay\webfiles\clientrawdaily.txt -> clientrawdaily.txt
Uploading C:\Program Files\wdisplay\webfiles\clientrawhour.txt -> clientrawhour.txt
*******actual messages from upload session********
***Start Time/date***:12:25:07 AM 12/15/2007
miz005.txt
miz005.txt
Permanent connection selected
Permanent connection, will do ftp now
Internet sharing...
Finshed email agenda
Finshed email agenda, and more Internet agenda items to do (FTP)....
***Time/date***:12:25:13 AM 12/15/2007
Logging onto FTP server....74.200.213.146
Connecting to FTP server.
Connected.
220 ProFTPD 1.3.1rc3 Server ready.
USER=****
331 Password required for bigbaywx
PASSWORD=****
230 User bigbaywx logged in
TYPE I
200 Type set to I
CWD /public_html
250 CWD command successful
Checking for next FTP agenda....
there are 1 more things to do
Doing ftp upload
Checking there are files to upload
There are more files to upload
PASV
227 Entering Passive Mode (74,200,213,146,182,194).
STOR index.html
150 Opening BINARY mode data connection for index.html
226 Transfer complete
PASV
227 Entering Passive Mode (74,200,213,146,182,195).
STOR wx3.html
150 Opening BINARY mode data connection for wx3.html
226 Transfer complete
PASV
227 Entering Passive Mode (74,200,213,146,182,196).
STOR wx5.html
150 Opening BINARY mode data connection for wx5.html
226 Transfer complete
PASV
227 Entering Passive Mode (74,200,213,146,182,197).
STOR clientraw.txt
150 Opening BINARY mode data connection for clientraw.txt
226 Transfer complete
PASV
227 Entering Passive Mode (74,200,213,146,182,198).
STOR clientrawextra.txt
150 Opening BINARY mode data connection for clientrawextra.txt
226 Transfer complete
PASV
227 Entering Passive Mode (74,200,213,146,182,199).
STOR clientrawdaily.txt
150 Opening BINARY mode data connection for clientrawdaily.txt
226 Transfer complete
PASV
227 Entering Passive Mode (74,200,213,146,182,200).
STOR clientrawhour.txt
150 Opening BINARY mode data connection for clientrawhour.txt
226 Transfer complete
No more files to upload
All Agenda complete, doing FTP log off....
FTP logoff
QUIT
221 Goodbye.
Disconnected.
Doing abort procedure/program close...

They are going into the public html directory which appears to be right.  If I open the index.html file directly from the control panel it pretty much prints right and is updated correctly.  I put up a temporary index.html page saying that I was working on the system and this is the page that appears when I load the website even though the index.html seems to be correct.  I've flushed the cache' on my end as well as looking at it in internet explorer which I never used.  I opened up a quick ticket to the hosting company to ask what gives.

But at this point I am seeing the web pages uploading to the server with the correct time stamps.  If anyone wants to look at my control panel PM me and I'll give you the password so you can take a quick look at it.

Thanks,
Doug

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #12 on: December 15, 2007, 12:41:21 AM »
Just received a reply back from the hosting company it appears that they are doing some working on stuff tonight.



Quote
http://www519.hostpc.com:2222
Use that address to login
www519.hostpc.com
FTP to that one

Your ISP probably not caught up with the IP swap that happen tonight

Also, update your DNS
ns519a.hostpc.com
ns519b.hostpc.com

O.K.,

So he's saying that there was an IP swap going on and my ISP wasn't caught up yet.   That might explain a few things.  I'll check it again in the morning.  Thanks for the helpful comments folks.

Offline Anole

  • Forecaster
  • *****
  • Posts: 585
    • http://pineislandweather.com
Re: Ajax Website Not Updating
« Reply #13 on: December 15, 2007, 08:13:02 AM »
My hosting company just shut down allow_url_fopen which killed my cronjobs for fetching nws forecasts and data "due to security considerations". They are in the middle of a platform migration and I'm told it will be enabled on the new platform. Regardless, one of the plans I've had for my site is to process this all locally so this is a good motivator to get that done.

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #14 on: December 15, 2007, 09:23:55 AM »
Well, I'm finally back up everything except the forecasts at this point appear to be broken.  This has been a PITA primarily because I'm real new at this stuff yet and troubleshooting these things is difficult.  I was ftp'ing to my given I.P. address and unknown to me the hosting company was doing some I.P. changes/upgrades/swaps and failed to notify me.  That was dandy.  From my perspective the files were being uploaded as I was in the old control panel and it was showing all the correct files and the dates/times were right.  Of course when I went to the new CP everything in their was old and nothing being updated so that's why everything appeared "stuck".  Oh well, live and learn I guess.  Thanks to all for their help and suggestions and I'll squirrel those things away for problems next time.  Hopefully the forecast issue will resolve itself....as far as I can see it's still set up right on my end and I see the program pulling down the forecast from NWS so I know thats working.  Ah, a learning experience!!   ](*,)

Offline BfdWx

  • WxElement panel
  • Senior Contributor
  • *****
  • Posts: 255
    • Branford Weather
Re: Ajax Website Not Updating
« Reply #15 on: December 15, 2007, 11:08:37 AM »
Quote
everything except the forecasts at this point

Hfcomms,

Since you are already using php why not use saratogawx's (and carterlake) script for the forecast? It is called advforecast2.php and can be found on his site along with great explanations and guides. Ken recently updated it to include some fail safe methods to ensure a forecast at all times. If you have any problems give a shout, plenty of people will help you with this.

Jack

Script site......http://saratoga-weather.org/scripts-carterlake.php#advforecast

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Senior Contributor
  • ****
  • Posts: 193
  • Davis Vantage Pro2+ with full FARS
Re: Ajax Website Not Updating
« Reply #16 on: December 15, 2007, 01:07:30 PM »
My hosting company just shut down allow_url_fopen which killed my cronjobs for fetching nws forecasts and data "due to security considerations". They are in the middle of a platform migration and I'm told it will be enabled on the new platform. Regardless, one of the plans I've had for my site is to process this all locally so this is a good motivator to get that done.

I actually don't use PHP for getting remote data for most things.  I use either Wget or Lynx.  Most of my php dynamic stuff works off of data that was already collected then which means file without URL's.

Code: [Select]
#!/www/bin/perl -w
#######################################################################
$WGET = '/usr/sfw/bin/wget';
$AGENT = 'TNETWeather WXbot - http://www.tnetweather.com/';
$TIMEOUT = 5;
$URL = 'http://www.wrh.noaa.gov/total_forecast/printable_forecast.php?wfo=psr&zone=azz023&county=azc013';
$NEWFL = 'azc013new.txt';
$DESFL = 'azc013.txt';

`$WGET -T $TIMEOUT -U '$AGENT' -q '$URL' -O $NEWFL`;
if ( -s $NEWFL > 10000  )  {
    rename $NEWFL, $DESFL;
} else {
    unlink $NEWFL;
}
All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
@ Firewall
« Reply #17 on: December 15, 2007, 03:13:24 PM »
@Jack,

Thank you for the suggestion.  I'm just starting to get into playing around with scripts so it will be interesting.  I went over to your site for a looksee and I like how the forecast prints on the bottom with the icons.  I'll take a look at at.  I'm assuming at this point the script is a lot like the ajax template where you just have to plug in your particulars. 

I would think off hand that your wx.html template would have to be changed somehow as well so that it doesn't attempt to pull the forecast down the old way and print it out where it does in the stock webpage.  Does the script take care of that as well??  I'll be downloading that and do some more reading. 

Thanks again,
Doug

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Questions on the forecast script
« Reply #18 on: December 15, 2007, 03:51:37 PM »
Questions on the forecast script,

Might as well leave it on this thread I guess.  O.K.  I downloaded the the script and the icon sets.  I see it's pretty self explanatory to upload the icon sets to a new folder in the public_html folder i.e. forecast/images so that's simple enough.  Also see in the script how to change to your zone forecast and to replace the stock url to your url for the point forecast.  Also to add the "?force=1" to the end of your point forecast url.  So far so good.

Now the questions or if you can point me to the thread where this has been discussed. Where does the script go first of all??  In the public html folder or do you copy and paste from the script and insert it in your index.html  page??  Also the initial forecast.txt file that was saved off of your point forecast does that get uploaded just to the public html folder??  The instructions would probably be pretty clear to someone used to working with scripts as it probably takes a few things for granted that a noob might not realize.  Thanks again in advance.

Doug

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax Website Not Updating
« Reply #19 on: December 15, 2007, 04:09:13 PM »
Questions on the forecast script,

Might as well leave it on this thread I guess.  O.K.  I downloaded the the script and the icon sets.  I see it's pretty self explanatory to upload the icon sets to a new folder in the public_html folder i.e. forecast/images so that's simple enough.
That's correct.

Also see in the script how to change to your zone forecast and to replace the stock url to your url for the point forecast.  Also to add the "?force=1" to the end of your point forecast url.  So far so good.
That's not quite correct.  the $fileName variable inside the advforecast2.php script needs to be changed to the URL for your point-printable forecast (follow the instructions inside the comments in the script).
The advforecast2.php script itself should be placed in the document root of your website (your html directory).  You also need to set the $NOAAzone variable in the script to the NOAA county warning zone for your area (instructions also in the comments in the script itself).
The ?force=1 shouldn't be added to the URL for advforecast2.php as it defeats the purpose of the cache .. it will reload the contents of the point-forecast from the forecast.weather.gov website.  That parameter is only used to reload the cache in case it was empty (fetch from forecast.weather.gov failed).

Now the questions or if you can point me to the thread where this has been discussed. Where does the script go first of all??  In the public html folder or do you copy and paste from the script and insert it in your index.html  page??  Also the initial forecast.txt file that was saved off of your point forecast does that get uploaded just to the public html folder??  The instructions would probably be pretty clear to someone used to working with scripts as it probably takes a few things for granted that a noob might not realize.  Thanks again in advance.

The advforecast.php script goes in your document root (same directory as your site's index.html file).

In c:\wdisplay\webfiles edit wxlocal2.html to replace
Code: [Select]
  <h3>National Weather Service Forecast</h3>
       
<p><b><span style="text-transform: uppercase">%5dayforecastdayday1%</span></b>
<br /><span style="text-transform: capitalize">%5dayforecastday1%</span></p>

<p><b><span style="text-transform: uppercase">%5dayforecastdayday2%</span></b>
<br /><span style="text-transform: capitalize">%5dayforecastday2%</span></p>

<p><b><span style="text-transform: uppercase">%5dayforecastdayday3%</span></b>
<br /><span style="text-transform: capitalize">%5dayforecastday3%</span></p>

<p><b><span style="text-transform: uppercase">%5dayforecastdayday4%</span></b>
<br /><span style="text-transform: capitalize">%5dayforecastday4%</span></p>

<p><b><span style="text-transform: uppercase">%5dayforecastdayday5%</span></b>
<br /><span style="text-transform: capitalize">%5dayforecastday5%</span></p>

<p><b><span style="text-transform: uppercase">%5dayforecastdayday6%</span></b>
<br /><span style="text-transform: capitalize">%5dayforecastday6%</span></p>

<p><b><span style="text-transform: uppercase">%5dayforecastdayday7%</span></b>
<br /><span style="text-transform: capitalize">%5dayforecastday7%</span></p>

<p>NWS Forecast: %5dayforecasttimestamp%</p>
with
Code: [Select]
<?php 
$doIncludeNWS 
true;
include(
"advforecast2.php");
?>

Then change the page type of the upload of wxlocal2.html from wx2.html to wx2.php -- you can do that with the Control Panel, Internet File Creation & Uploads, Setup Page#2 TAB,
File #23 wxlocal2.html
Press Set, then press Show File Upload times to reveal the FTP Settings area at the top.
Change wx2.html to wx2.php
Turn 'Use these settings' to ON
Press OK to save the changes

With luck, you should have a wx2.php page on your site with current gizmo conditions, AND a icons/text forecast from the NWS showing.
Don't forget to change the links section in all your pages to reflect that the forecast is now on wx2.php instead of wx2.html

Best regards,
Ken

Doug
[/quote]
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #20 on: December 15, 2007, 05:07:15 PM »
@Ken

Thanks for taking the time to help.  That makes it much clearer to me.  At work tonight so I'll make the changes tomorrow.  1 more quick question....the forecast.txt file that I downloaded from my point forecast url I guess is to be used as the initial forecast and then the script will make sure it gets updated.  Where do I put that forecast??  I'm guessing in the forecast root folder and not the public_html folder??  Pretty sure it's the forecast root as that makes more sense but wanted to make sure.

Thanks again!!

Doug

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax Website Not Updating
« Reply #21 on: December 15, 2007, 06:04:17 PM »
Doug,
You're very welcome!
The forecast.txt file should be in the same directory as the advforecast2.php script (your public_html folder).  The script will create one there and it will be used to contain the page from forecast.weather.gov showing your point-printable forecast.  The advforecast2.php script will automatically update the cache (forecast.txt) when needed (when the cache file is older than 30 minutes).

Make sure that the forecast.txt file is 'writable' by the advforecast2.php script (usually means setting the file permissions to 666 or 777 using your web hoster's control panel).

Looking at your http://www.bigbaywx.com/advforecast2.php page, I see
Code: [Select]
Warning: filemtime() [function.filemtime]: stat failed for forecast.txt in /home/bigbaywx/domains/bigbaywx.com/public_html/advforecast2.php on line 159 which indicates that the advforecast2.php script can't write to 'forecast.txt' in the same directory.
Just create a blank 'forecast.txt' file with notepad and ftp it to your website in the same directory as advforecast2.php.
Then use your website control panel to change the permissions to 666 for 'forecast.txt'
Then run http://www.bigbaywx.com/advforecast2.php?force=1 once to fill the cache.
You should then see the forecast with icons on your browser.

Also, make sure you upload advforecast2.php without any blank lines or text or blanks before the starting <?php in the first line of the advforecast2.php page. So take out the stuff at the start of the page like
Code: [Select]
<html>
<head>
<title>NWS Forecast for </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; background-color:#FFFFFF">
as it's not needed.

Best regards,
Ken
« Last Edit: December 15, 2007, 06:14:11 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline BfdWx

  • WxElement panel
  • Senior Contributor
  • *****
  • Posts: 255
    • Branford Weather
Re: Ajax Website Not Updating
« Reply #22 on: December 15, 2007, 06:42:03 PM »
Doug,

Nice progress....looking great! Once you master this one there are several other php scripts that will keep you busy all winter (well, it took me that long  #-o). The thing to remember and grasp is that php scripts are server side scripts, meaning the server does the work. Eventually you may want to consider changing all of your html pages to php. Ken's site is an excellent resource and you'll find him one of the most helpful people on the planet!

Jack

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #23 on: December 15, 2007, 07:08:05 PM »
Thanks to both...

Your way ahead of me though Ken.   =D&gt;  I'm at work stuck on dial up so I uploaded the icons into the correct folders and made the appropriate changes to the script and uploaded that as well.  I had put the forecast.txt into the forecast folder but I'll move it to root.  I won't be able to change the wx.local file or the other changes with the php code until I get home tonight late or I'll do it after work tomorrow.

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #24 on: December 15, 2007, 11:56:10 PM »
O.K.

The script is working for the forecast for wx2.php but on the index page it's still showing the same 2 day forecast to the right of the radar display.  The stock index page has....

Quote
<h3>FORECAST</h3>
<p><b><span style="text-transform: uppercase">%5dayforecastdayday1%</span></b>
<br /><span style="text-transform: capitalize">%5dayforecastday1%</span></p>

<p><b><span style="text-transform: uppercase">%5dayforecastdayday2%</span></b>
<br /><span style="text-transform: capitalize">%5dayforecastday2%</span></p>

I would replace that with what to get a few days worth of icons and descriptions for the main page??

Thanks again for the help....making some progress here.


Man...I thought it was cold.  Just looked at the temp.  2.8 degrees and still dropping a degree an hour.
« Last Edit: December 15, 2007, 11:58:34 PM by Hfcomms »

 

anything