On 28 June 2010 15:42, gmail <agbo...@gmail.com> 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 -

There are also a lot of user notes covering email address validation.


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

Reply via email to