Re: [PHP-DB] Email validation
On 28 June 2010 15:42, gmail wrote: > Hello to you all! > > I'm facing a problem with a scrip that can validate a form witch accept only > as input email address. > > I have seen many scripts on the net and were very interesting but I'm not > able to implement those scripts on my need. > > I'm explaining myself better! > > I have a form to collect a User Input Email address, > > After a script to check the syntax of the user email is correct. > > Then check the mx record if really exist. > > At the end if the user input (email) meets all my requirements the pass it > (store) in a DB. > > Please I'll be grateful to all your possible solutions > > Thanks. > > > > How much detail do you want? Validating email addresses goes from the mundane to the extreme. The rules on the EXACT format of an email address are significant. Reading http://en.wikipedia.org/wiki/E-mail_address#RFC_specification will give you a lot of detail. There are MANY regular expressions available, again, covering some aspects of a "valid" email address. Some cover more than others. http://www.regular-expressions.info/email.html has a good explanation regarding email address validation using regular expressions (and is part of the RegexBuddy documentation). Note the last line ... "So even when following official standards, there are still trade-offs to be made. Don't blindly copy regular expressions from online libraries or discussion forums. Always test them on your own data and with your own applications." As for the MX part, PHP has the getmxrr() function for this task - http://docs.php.net/manual/en/function.getmxrr.php There are also a lot of user notes covering email address validation. Richard. -- - Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Email Validation
No. Some mail servers (qmail for sure) have the user auth section seperated from the piece that accepts mail from the internet. As long as the mail is for the correct domain, it will accept it, and passes it to a seperate program that checks for the user and either bounces or delivers the mail. -Original Message- From: cristi radulescu [mailto:[EMAIL PROTECTED]] Sent: Friday, March 08, 2002 7:13 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Email Validation hi there, is there any way to check the existence of an e-mail address without sending an email? i mean not only DNS lookup, but also user validation? 10x, cristi radulescu http://translator.urbanxp.org http://www.urbanxp.org ML> On Fri, 2002-03-08 at 04:10, CrossWalkCentral wrote: >> How would I go about doing the DNS look up part? ML> with checkdnsrr() I'd assume: ML> checkdnsrr($host) ML> "Searches DNS for records of type type corresponding to host. Returns ML> TRUE if any records are found; returns FALSE if no records were found or ML> if an error occurred." ML> the default type is MX. ML> http://www.php.net/manual/en/function.checkdnsrr.php _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Email Validation
hi there, is there any way to check the existence of an e-mail address without sending an email? i mean not only DNS lookup, but also user validation? 10x, cristi radulescu http://translator.urbanxp.org http://www.urbanxp.org ML> On Fri, 2002-03-08 at 04:10, CrossWalkCentral wrote: >> How would I go about doing the DNS look up part? ML> with checkdnsrr() I'd assume: ML> checkdnsrr($host) ML> "Searches DNS for records of type type corresponding to host. Returns ML> TRUE if any records are found; returns FALSE if no records were found or ML> if an error occurred." ML> the default type is MX. ML> http://www.php.net/manual/en/function.checkdnsrr.php _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Email Validation
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 [EMAIL PROTECTED] +358-6-325 3589 / +358-40-832 6709 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Email Validation
How would I go about doing the DNS look up part? "Markus Lervik" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > 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. > > > Cheers, > Markus > > -- > Markus Lervik > Linux-administrator with a kungfoo grip > Vaasa City Library - Regional Library > [EMAIL PROTECTED] > +358-6-325 3589 / +358-40-832 6709 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Email Validation
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. Cheers, Markus -- Markus Lervik Linux-administrator with a kungfoo grip Vaasa City Library - Regional Library [EMAIL PROTECTED] +358-6-325 3589 / +358-40-832 6709 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Email Validation
have a look at the online annotated php manual under the regular expression functions, there are *stacks* of examples of using regexps to validate email patterns beau // -Original Message- // From: CrossWalkCentral [mailto:[EMAIL PROTECTED]] // Sent: Tuesday, 12 February 2002 12:20 PM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] Email Validation // // // 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 // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php