Trying to implement weather script from Weather.com into my site. All sources are at
http://www.ravis.org/code/weather/ . Weather code USFL0372 (if you must know, probably won't use/need it). PHP Scripts downloadable from site posted above are in the same directory as the HTM file. There is something wrong I am doing in the HTM file, with a copy & paste of it's contents below. Newbie to PHP. Thanks. Note: This is the code I'm TRYING TO COPY: FURTHER DOWN AFTER THE ----'s is the code I have written.
PAGE CONTAINING CODE I AM TRYING TO COPY:
<form name="form1" method="get" action="index.php">
<div align="center" class="bodyText">Enter a City ID to test:
<input type="text" name="CityID" value="<? print $HTTP_GET_VARS["CityID"]; ?>">
<input type="submit" name="Submit" value="Submit">
</div></form>
<hr>
<?
if (isset($CityID)) {
// This is the code you need to have on your page.
// $CityID is being submitted from the user via the
// form you filled in. You can replace it with a
// static string if you like (eg: "USPA0380")
// Naturally you can replace $Weather->OutputDebug
// with your own calls (getTemp for example)
include("Weather.php");
$Weather = New Weather($HTTP_GET_VARS["Ci
tyID"]);
$Weather->OutputDebug();
// End weather fetching code. Easy, eh?
?>
<hr>
<p class="bodyText">If everything above looks correct but the script running on
your server doesn't produce output you may want to...</p>
<ol class="bodyText">
<li>Make sure you have a valid city code! <a href="
http://www.weather.com/weather/local/<? print $HTTP_GET_VARS["CityID"]; ?>">Click
here</a> to find out...</li>
<li> Make sure you have the <a href="../">lastest version</a> of the weather
script</li>
<li><a href="source.php">View the source code</a> for this page as an example
(hey, it's working, right?)</li>
<li>Check that your copy of PHP allows outbound connections.</li>
</ol>
<p class="bodyText">If <a href="../../webcell/">WebC
ell</a> (and therefore Weather)
can't connect you should receive a warning "Could not connect to server '
www.weather.com:80'".
This means one of three things: Weather.com is down (unlikely); something is
wrong with your network; or (most likely) that your copy of PHP is configured
to deny outgoing connections. The first case I can't help you with because I
don't have anything to do with Weather.com, and the last two I can't help you
with because I don't have anything to do with your systems / network - please
talk to your sysadmin.</p>
<p class="bodyText">If, however, the output above is missing or showing incorrect
data, please <a href="../../contact/">let me know</a> so I can update the script...
<p class="bodyText">Otherwise
, back to the <a href="../">weather page</a>!
<p>
<?
}
?>
</p>
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
--
PAGE CONTAINING CODE I WROTE, BUT CAN'T GET TO WORK:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script type="text/javascript" language="JavaScript1.2" src="stm31.js"></script>
</head>
<body link="#FF0000" vlink="#800000" alink="#808080" bgcolor="#E0DFE3" style="text-align: center" background="../lava.jpg">
<p align="center"> </p>
<p align="center">
<img border="2" src="Welcome.jpg" style="border-style: solid; border-width: 1; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1"></p>
<table border="1" cellpadding="0" cellspacing="0" width="512" bordercolor="#FFFFFF" bordercolorlight="#C0C0C0"
bordercolordark="#C0C0C0" id="table1" bgcolor="#C9C7CD" style="border-style: outset; border-width: 3; margin-top: 1; margin-bottom: 1" height="76">
<tr>
<td>
<p align="center">
<b>
<font face="Tw Cen MT Condensed Extra Bold" color="#800000" style="font-size: 15pt">
Edgewater High School</font><font face="Tw Cen MT Condensed Extra Bold" color="#ffffff" style="font-size: 15pt"><br>
</font>
<font face="Tw Cen MT Condensed Extra Bold" color="#800000" style="font-size: 15pt">
3100 Edgewater Drive Orlando, Florida 32804-3722</font><font face="Tw Cen MT Condensed Extra Bold" color="#ffffff" style="font-size: 15pt"><br>
</font>
<font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">
<font face="Tw Cen MT Condensed Extra Bold" color="#000000" style="font-size: 15pt">
Office:</font><font face="Tw Cen MT Condensed Extra Bold" color="#ffffff" style="font-size: 15pt"> </font></font>
<font face="Tw Cen MT Condensed Extra Bold" color="#800000" style="font-size: 15pt">
407-835-4900</font><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000"><font face="Tw Cen MT Condensed Extra Bold" color="#ffffff" style="font-size: 15pt"> </font>
<font face="Tw Cen MT Condensed Extra Bold" color="#000000" style="font-size: 15pt">
Fax:</font><font face="Tw Cen MT Condensed Extra Bold" color="#ffffff" style="font-size: 15pt"> </font></font>
<font face="Tw Cen MT Condensed Extra Bold" color="#800000" style="font-size: 15pt">
407-245-2758 </font>
<font face="Verdana, Arial, Helvetica, sans-serif" color="#000000">
<font face="Tw Cen MT Condensed Extra Bold" color="#ffffff" style="font-size: 15pt">
<br>
</font>
<font face="Tw Cen MT Condensed Extra Bold" color="#000000" style="font-size: 15pt">
CEEB</font><font face="Tw Cen MT Condensed Extra Bold" color="#ffffff" style="font-size: 15pt"> </font>
<font face="Tw Cen MT Condensed Extra Bold" color="#000000" style="font-size: 15pt">Code: </font>
<font face="Tw Cen MT Condensed Extra Bold" color="#800000" style="font-size: 15pt">101290</font></font>
</b></td>
</tr>
</table>
<div align="center">
<table border="1" cellpadding="0" cellspacing="0" width="512" bordercolor="#FFFFFF" bordercolorlight="#C0C0C0"
bordercolordark="#C0C0C0" id="table2" bgcolor="#C9C7CD" style="border-style: outset; border-width: 3; margin-top: 1; margin-bottom: 1">
<tr>
<td>
<p align="center">
<font face="Bauhaus 93" size="6" color="#800000">Weather Report:</font><p align="center"></td>
</tr>
</table>
</div>
<hr>
<?PHP
if (isset(USFL0372)) {
include("Weather.php");
$Weather = New Weather($HTTP_GET_VARS["Ci
tyID"]);
$Weather->OutputDebug();
}
?><hr>
</body>
</html>