I am trying to get Ken’s ajax-testpage working so that I can use it to better understand how to modify some items on my php/ajax pages. I have read and re-read the threads dealing with this but I seem to be stuck with an error I don’t understand.
I have got testtags.php uploading properly and have ajax.php & ajax-testpage.php in place but they don’t work properly. I have looked at ajax-testpage in Firefox with Firebug and the error I get is ‘ajaxLoader is not defined’. The link takes me to the onload statement but if I compare it to anything else it is exactly the same. What am I missing? The file can be accessed here http://weather.victorfd.org/ajax-testpage.php . Would somebody please take a look and see if you can spot my problem?
I also noticed that Kens ajax-testpage.php demo page is different than the one in the demo package. I tried that version and I can then get the ajax functions working but it seems to reference a different page for the php variables.
I have most of my main php pages working with ajax but am still working on how to add in a few that are still being called by php variables. The no-javascript issue is important to me because my employer has javascript disabled so I am also working on understanding the functions. I’ll get it eventually but this has me stumped.
Sorry you’re having difficulties with the AJAX demo pages. I just compared the dates in the ajax-1-04.zip and on my site (for ajax.php and ajax-testpage.php) and they’re the same, so I think the problem may lie with the upload of the testtags.php by WD. When I do a http://weather.victorfd.org/testtags.php?sce=view I’d expect to see something like this displayed (sample from my current testtags.php)
<?php
// converted tagslist.txt to .\tagslist.php for php tags
// by gen-PHP-tagslist.pl - Version 1.00 - 07-Apr-2006
// Author: Ken True - webmaster-weather.org
// Edited: 20-Apr-2006 to trim unused tags
// --------------------------------------------------------------------------
// allow viewing of generated source
if ( $_REQUEST['sce'] == 'view' ) {
//--self downloader --
$filenameReal = $_SERVER["PATH_TRANSLATED"];
$filenameLcl = substr($PHP_SELF,1);
$download_size = filesize($filenameReal);
header('Pragma: public');
header('Cache-Control: private');
header('Cache-Control: no-cache, must-revalidate');
if ($mode == 'download' ) {
header("Content-type: application/x-download");
header("Content-Disposition: attachment; filename=$filenameLcl;");
} else {
header("Content-type: text/plain");
}
header("Accept-Ranges: bytes");
header("Content-Length: $download_size");
header('Connection: close');
readfile($filenameReal);
exit;
}
// General OR Non Weather Specific/SUN/MOON
// ========================================
$time = "12:15 PM"; // current time
$date = "12/11/2006"; // current date
$sunrise = "7:12am"; // sun rise time (make sure you have the correct lat/lon
// in view/sun moon)
$time_minute = "15"; // Current minute
$time_hour = "12"; // Current hour
$date_day = "11"; // Current day
$date_month = "12"; // Current month
$date_year = "2006"; // Current year
$monthname = "December"; // Current month name
$dayname = "Monday"; // Current day name
$sunset = "4:50pm"; // sunset time
$moonrise = "10:43pm"; // moon rise time
$moonset = "11:59am"; // moon set time
$moonage = "Moon age: 21 days,11 hours,15 minutes,57%"; // current age of the moon (days since new moon)
$moonphase = "57%"; // Moon phase %
$weatherreport = "mostly cloudy"; // current weather conditions from selected METAR
$stationaltitude = "375"; // Station altitude, feet, as set in the units setup
// this under setup)
$stationlatitude = "037:16:28"; // Latitude (from the sun moon rise/set setup)
$stationlongitude = "0122:01:23"; // Longtitude (from the sun moon rise/set setup)
// ADVISORIES)
// ADVISORIES)
$wdversion = '10.36x' . '-(' . '09' . ')'; // Weather Display version number you are running
$wdversiononly = '10.36x';
$wdbuild = '09'; // Weather Display build number you are running
// ....What it says - for the weather warning....
$monthname = "December"; // Current month name
//
// this under setup)
$noaacityname = "Saratoga"; // City name,from the noaa setup (in the av/ext setup)
//
// level...enter this under setup)
//
$timeofnextupdate = "12:20 PM"; // Time of next Update/Upload of the weather data to your web page (based on the web table update
//
// time)
//
// must be first selected),,,,repeat up to day 8
$heatcolourword = "Cool"; // How hot/cold it feels at the moment, based on the humidex, used with the conditionscolour.jpg
//
// image (which is updated with the gizmo.gif)
// i.e use this code:
// <img alt="WapSeer Control" src="graphtemp15.wbmp" vspace="0" hspace="0" align="middle"/>
// <img alt="WapSeer Control" src="graphwind15.wbmp" vspace="0" hspace="0" align="middle"/>
//
// Averages/Extreme
// ================
//
//
// month and then the year numbers
// e.g for the average temperature for 8am (use a 24 hour clock) (hour preceding that, for the
//
// month of March 2003)
//
// month and then the year numbers
//
//
//
//
// (total for the current month)
//
// current month as total) (from your entered averages)
//
//
//
//
//
//
//
//
//
// Temperature/Humidity
// ====================
// Current:
// --------
$temperature = "57.0
I have it set up in WD in the custom web page uploads, custom file conversion. Can I e-mail you copies of testtags.txt before upload and testtags.php after upload for you to take a look at?