Thanks to some advice on this forum I managed to get my page correctly checking for a cookie and processing the page as intended. Unfortunately a form to email script actioned when the form is submitted doesn’t work now. (it should send the value of 'email' to a specified address). The script hasn’t been modified, just the PHP code that determines whether to display the login form or not.
I have included the amended logic below. Appreciate suggestions for what is the problem here.
Thanks
David
<h1>Free resources</h1>
<?
if (isset($_COOKIE['email'])) {
?>
<ul><li><a href="#">Access free resources</a></li></ul>
<?
} elseif ($_GET['checkit']) {
echo "<ul><li><a href="#">Access free resources</a></li></ul>";
}
else {
?>
<p>Please enter your email address below to access the free SMILE resources.</p>
<form name="emailaddress" id="emailaddress" title="Email address" onsubmit="return formvalidation();" method="post" action="<? echo $_SERVER['cgi-bin/formtomailscript2.cgi']; ?>">
<table id="emailtable">
<tr>
<td class="input"><input name="email" id="email" type="text" size="23" /></td>
</tr>
<tr>
<td>
<div align="center">
<input name="submit" id="submit" type="submit" value="submit" />
</div>
</td>
</tr>
</table>
</form>
<script language="JavaScript" type="text/javascript">
<!--
document.getElementById('email').focus();
// -->
</script>






Bookmarks