Hi,
This has completely stumped me. I have a page that is trying to use PHP and CSS at the same time. There should be no reason it won't work. The page displays fine until I add the php at the top of the page, and then I get this error message:
Parse error: parse error, unexpected $ in /home/mfleming/lightningshotspots.com/html/addlocation.php on line 98
Again, everything works fine until I add the php at the head of the page that deals with db login. I may be missing something fundamental here, but I just can't figure it out!
<?php
$db = mysql_connect("xxxx", "xxxx", "xxxx");
mysql_select_db("lightning",$db);
if ($submit) {
$sql = "INSERT INTO shotspots (latitude,longitude,description,name,email,status) VALUES ('$latitude','$longitude','$description','$name','$email','$status')";
$result = mysql_query($sql);
header ("Location: thanks.php");
} else {
?>
<html>
<head>
<title>Lightning Shot Spots - Add Location</title>
<link rel="stylesheet" href="lightning.css" type="text/css" media="screen">
<link rel="shortcut icon" href="images/favicon.ico" >
<script language="JavaScript">
<!--hide
function latlongwindow()
{
window.open('http://www.sirzman.com/gc/llf.cfm','jav','width=400,height=400,resizable=yes')
}
//-->
</script>
</head>
<body>
<div id="banner">
<h1>Lightning Shot Spots</h1>
</div>
<br />
<center>
<!--
<form method="post" action="<?php echo $PHP_SELF?>">
<fieldset>
<legend>Add Lightning Shot Spot Location</legend>
<p><label for="Latitude">Latitude</label><input type="text" id="latitude" name="latitude" /> Please enter in decimal notation, i.e. 32.3967<p />
<p><label for="Longitude">Longitude</label><input type="text" id="longitude" name="longitude" /> Please enter in decimal notation, i.e. -110.974<p />
<p>Use <a href="javascript:latlongwindow()">this page</a> (opens in new window) to calculate the Lat/Long for your location.<p />
Description : <br><textarea rows="10" cols="80" name="description">Please enter a description of your location </textarea><br />
<p><label for="Name">Name</label><input type="text" id="name" name="name" /><p />
<p><label for"Email">Email</label><input type="text" id="email" name="email" /><p />
<input type="visible" name="status" value="VISIBLE">
<p><class="submit"><input type="submit" value="Submit" /></p>
</fieldset>
</form>
-->
<form method="post">
<table border="1" width="600">
<tr>
<td align="right">Latitude</td>
<td align="left"><input type="text" iname="latitude"> Please enter in decimal notation, i.e. 32.3967
</tr>
<tr>
<td align="right">Longitude</td>
<td align="left"><input type="text" iname="longitude"> Please enter in decimal notation, i.e. 32.3967
</tr>
<tr>
<td colspan="2" align="center"><p>Use <a href="javascript:latlongwindow()">this page</a> (opens in new window) to calculate the Lat/Long for your location.<p /></td>
</tr>
<tr>
<td align="right">Description</td>
<td align="left"><textarea rows="10" cols="60" name="description"></textarea></td>
</tr>
<tr>
<td align="right">Name</td>
<td align="left"><input type="text" name="name"></td>
</tr>
<tr>
<td align="right">Email</td>
<td align="left"><input type="text" name="email"></td>
</tr>
<tr>
<td colspan="2"><input type="visible" name="status" value="VISIBLE"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Submit"></td>
</tr>
</table>
</form>
</center>
<br>
<div id="safety">
<center>
<p class="bold">Lightning is DANGEROUS! Before going out to take some pictures, learn about Lightning Safety below:</p>
</center>
<ul>
<li><a href="http://www.lightningsafety.com/">National Lightning Safety Institute</a>
<li><a href="http://www.lightningsafety.noaa.gov/">NWS Lightning Safety</a>
<li><a href="http://weathereye.kgan.com/cadet/lightning/safety_rules.html">Lightning Safety from KGAN</a>
</ul>
<p class="bold">DISCLAIMER : Lightning is DANGEROUS, and can be DEADLY! This site intends to provide locations that experienced photographers can go to take pictures of lightning. It's assumed that you have studied lightning saftey, and that safety takes precedence over a good shot. Lightning Shot Spots cannot be help responsible for injury (or death) incurred while taking pictures at these locations. Seriously...use common sense out there.</p>
</div>
</body>
</html>
If anybody has any thoughts on this, it would be greatly appreciated! According to my editor, line 98 is the last line of code, and there is no $ there that I can see. I even removed the whitespace at the end of the line.
Thanks!