Re: More Email ereg Validation

From: Date: Thu, 05 Apr 2001 08:44:56 +0000
Subject: Re: More Email ereg Validation
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47207@lists.php.net to get a copy of this message
Jason Murray wrote: > > Function validEmail($emailaddress) > { > // Decides if the email address is valid. Checks syntax and DNS > // records, for total smartass value. Returns "valid", "invalid-mx" > // or "invalid-form". > > if > (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", > $emailaddress, $check)) > { > if ( checkdnsrr(substr(strstr($check[0], '@'), 1), "ANY") ) > { return "valid"; } > else > { return "invalid-mx"; } > } > else > { > return "invalid-form"; > } > } > > If it gets through the first match with ".om", it won't get through the > checkdnsrr(). > > Jason > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net Good idea... that $. Also the checkdnsrr is a nice feature. But.... I'll have to remind you on a previous thread about quite the same problem. The checkdnsrr can slow down the performance of your own site. It _can_ make it terribly slow. Draw your own conclusion. -- * R&zE: *************************** ** Renze Munnik ** ** E: renze@datalink.nl ** M: +31 6 218 111 43 ***************************

« previous php.general (#47207) next »