If the regexp matches, it is a valid email, so you need ! in front of it.
dan radom wrote:
>I've got a form that's posted to a php page where I'm attempting to validate a field
>contains a valid email address. The eregi below seems to be totally ignored...
>
> if (eregi("^[a-z0-9\._-]+@[a-z0-9\._-]+$", $emp_email)) {
> echo "<center>please enter a valid email address</center>";
> exit;
> }
>
>
>$emp_email is being posted to the form. Any ideas why this is being ignored?
>
>dan
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php