function validate_email($email) {
$regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,6})$";
if (eregi($regexp, $email)) return 1;
else return 0;
}
if (isset($_POST['submit'])){
echo "Hi ".$_POST['name']."!
";
if (validate_email($_POST['email']))
echo "The address ".$_POST['email']." is valid!";
else
echo "The address ".$_POST['email']." is invalid!";
}
?>