Re: Email Validation

From: Date: Fri, 08 Mar 2002 12:40:21 +0000
Subject: Re: Email Validation
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-17570@lists.php.net to get a copy of this message
On Fri, 2002-03-08 at 04:10, CrossWalkCentral wrote: > How would I go about doing the DNS look up part? with checkdnsrr() I'd assume: checkdnsrr($host) "Searches DNS for records of type type corresponding to host. Returns TRUE if any records are found; returns FALSE if no records were found or if an error occurred." the default type is MX. http://www.php.net/manual/en/function.checkdnsrr.php > > On Tuesday 12 February 2002 06:19, CrossWalkCentral wrote: > > > > > I am working on a form that I have in php and am looking for some advise > > > on form validation or specifically email address validation so i can > > > insure that some one has put in a properly formatted email address > > > > Well. something like > > > > if (!eregi("^[A-Za-z0-9\_-]+@[A-Za-z0-9\_-]+.[A-Za-z0-9\_-]+.*", $email)) > { > > echo "$email doesn't seem to be a valid e-mail address!"; > > } > > > > would do the job. Of course, that doesn't stop people from entering a > false > > email address. You could do a DNS-lookup to see if the domain-part of > > the address really exists, too. -- Markus Lervik Linux-administrator with a kungfoo grip Vaasa City Library - Regional Library markus.lervik@vaasa.fi +358-6-325 3589 / +358-40-832 6709

« previous php.db (#17570) next »