if (empty($_POST['email1'])) { $p=FALSE; $message .= '

You forgot to enter your email address!

'; } else { if ($_POST['email1'] == $_POST['email2']) { $p = $_POST['email1']; } else { $p = FALSE; $message .= '

Youe email did not match the confirmation email address!

'; } } $email = "$p"; if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { echo "Valid email address."; } else { echo "Invalid email address."; }