I am creating a form and one item inside the form (of course) is an email address field which I am trying to validate and make sure it is correct email structure.
I have found many tutorials online and none seem to work:
my code:
setting the variable
$email = trim($_POST['email']);
checking to see if the user has entered something into the email textbox
$problem = FALSE;
if (empty ($email)) //check for email address
{
$problem = TRUE;
echo '<p>You forgot to enter your email address, Please hit the back button and fill in the missin information</p>';
}
From the form:
<tr>
<td align="right">* Email Address: </td>
<td align="left"><input name="email" type="text" maxlength="50" /></td>
</tr>
How can I check to see if the email is in the correct format. I am not necessarly worried about it actually being a correct email address