I have a simle form for the sender's name, email, and comments.
I am attempting to validate for the name and comment fields having some content - and the email being valid, as follows:
if (empty($Name) || empty($Comments)) {
if(!eregi("^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$", $email)) {
header( "Location: $errorurl" );
exit ;
}}
The content checking for name and comments work fine. But anything gets through for the email. What am I doing wrong?