On Wed, 24 Jul 2002, Mike Mannakee wrote: > Here's the code I use to validate emails: > > function check_email($email) > { > global $email; > $regex="^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$"; > return eregi($regex, $email, $trash); > }
Please search the archives on this topic; it's been covered exhaustively, and each time it comes up we get 25 bad functions and eventually one good one. The above function will bark at valid domains (.museum, etc.) and will allow patently invalid domains (anything containing _). miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php