Hi all. I'm getting the wierdest parse error in my PHP script and i just can't figure out where abouts the errors coming from. It says line 40 but line 40 is the last line '<html>'. therefore I figured it may be an unclosed loop but i cant find one anywhere. Anyway, i've posted the whole page because i dont know where the error is. It still gives me an error when i comment the whole script out with //.
Here it is:
<?php include("dbconnect.php"); ?>
<html>
<head>
<link rel="stylesheet" href="general.css" type="text/css">
</head>
<body style="background-color:#000000; margin-top:0px;">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td valign="top"><span class="heading">Mailing List</span>
<?php
if (isset($_POST['Submit'])) {
$email = trim($_POST['email']);
$result = mysql_query("SELECT email FROM mailinglist WHERE email='$email'", $connection) or die(mysql_error());
` if (mysql_num_rows($result)>0) {
echo "<p align='center'>This address has already been added to our mailing list.<br><br><a href='index.php?page=cp_home' target='_parent'>Return</a></p>";
}else{
$addresult = mysql_query("INSERT INTO mailinglist (email) VALUES ('$email')", $connection) or die(mysql_error());
echo "<p align='center'>Thank you. Your address has been successfully added to our mailing list.<br><br><a href='index.php?page=cp_home' target='_parent'>Return</a></p>";
}
}else{
?>
<form name="form1" method="post" action="">
<p>By joining our mailing list you'll receive our frequent newsletter containing all the latest news,
gigs and site updates. All you've got to do is enter your email address below and you'll instantly begin receiving the latest SCAR:RED info.</p>
<div align="center">
<p><span class="subheading">Email Address:
</span>
<input name="email" type="text" class="field" id="email" size="30" maxlength="255">
</p>
<p>
<input name="Submit" type="submit" class="button" value="Subscribe">
</p>
</div>
</form>
<?php } ?>
</td>
</tr>
</table>
</body>
</html>
Many thanks,
BIOSTALL