Hello,
I am trying to get an email to validate my code is
<form name="form1" method="post" action="Copy of aaa.php">
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#0033FF" bgcolor="#DEE3EF" >
<tr><td width="100%"><table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#DEE3EF">
<caption align="top" class="heading">
E-Mail Validation
<br>
<tr>
<td width="46%"><br />
<div align="right">Enter An Email Address: </td><td width="54%"><br />
<input name="txt" type="text" id="email" name="EmailAddress">
</tr>
<tr>
<td colspan="2"> <div align="center"><br>
<input name="Submit" type="submit" class="button" value="Submit">
</div>
</td>
</tr>
</td>
(the above is saved as aaa.php)
and the page with the php code has
<?php
$EmailAddress=$_POST['EmailAddress'];
if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $EmailAddress)) {
echo "Valid email address.";
}
else {
echo "Invalid email address.";
}
?>
and the above here is saved as Copy of aaa.php
When run that, no matter what e-mail address I enter I am always told it's an invalid e-mail. What am I doing wrong?