Thank you to Yang (Is that your first name?) and Andy for your suggestions.
I am 99% of the way there but now cannot get the "Reset" button to work.
I have included the whole of my code and would appreciate it if someone
could explain where I am going wrong.
TIA
Roger
<?php
$message="";
if (isset($HTTP_POST_VARS['submit']))
{
$re =
"^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.([a-z]){2,3})$" ;
if (eregi($re,$HTTP_POST_VARS['emailAddress'])){
$a = true;
$message = "<font color=\"green\"><b>Hooray - The email address you entered
was valid!</b></font>";
}else{
$a = false;
$message = "<font color=\"red\"><b>It Sucks! - The email address you entered
was NOT valid. Please try again!</b></font>";
}
}else{
$HTTP_POST_VARS['emailAddress']="Enter Here";
$HTTP_POST_VARS['submit']= false;
}
?>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- Creation date: 05/02/2004 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="Institute of Criminology" />
<meta name="generator" content="AceHTML 5 Pro" />
</head>
<body>
<?php if($message){
print ("$message <br />\n");
}else{
print("<font color=\"red\"><b>You didn't enter anything. Please try
again!</b></font><br />");
}
?>
<form name="myForm" action="email.php" method="post">
<table cellpadding="5" border="1" class="text-align: center">
<tr>
<td>Enter your email address</td>
<td><input type="text" name="emailAddress" value="<?php echo
$HTTP_POST_VARS['emailAddress']?>"></td>
</tr>
<tr>
<td colspan="2" align = "center">
<input type="submit" name="submit" value="SUBMIT">
<input type="reset" name="reset" value="RESET">
</td>
</tr>
</table>
</form>
</body>
</html>