I have a register script and i want to validate that people have typed in their email correctly, but this doesnt seem to work? any ideass?
if ($_POST){
$email=stripslashes($_POST['email']);
$valid=eregi('^([0-9a-z]+[-._+&])*[0-9a-z]+@([-0-9a-z]+[.])+[a-z]{2,6}$',$email);
if (!$email && !$valid){
$_SESSION['error'] = "I'm sorry but the email you specified is not valid. Please enter a valid email";
unset($email);
header("Location: register.php");
exit;
}
}