[PHP] Email validation
Is there a simple function that validate an email adres Thx Jeroen Timmers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Email validation
Hello Again, Can anyone tell me what the best form of Email validation there is? It needs to be quick & as open to - and . as possible. I've seen the following: But this one looks quite impressive too: Not sure which is the best. Mike -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Latest Featured Site: http://www.lornenystrom.org/ No problem can be solved with the same thinking that created it - A.Einstein -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] email validation (discussion)
Greetings, I saw this posted in this group a few days back: function validEmail($email) { if (eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $email)) { return TRUE; } else { return FALSE; } } I passed it onto a programmer friend of mine to help me get my head around the regexp, which he did help me with, but then continued to point out that this function would return FALSE for many many valid email address', and I agree. I had a look at the mail-header standard (RFC-822), and almost ANYTHING is a valid email address... The user (prefix of the @) can contain all sorts of special characters (",',(,),etc) that weren't allowed for in the above regexp. The domains (suffix of @) can basicaly be defined as "two or more groups of a-z0-9, separated by a period (.)" I *think* the above regexp does this, but I'm no where near an expert. So I'd rather have a regexp which loosly checks for a valid email, rather than the very strict one above, which would appear to reject some valid address'... To me, checking for something like... "anything"@"two or more groups of a-z0-9, separated by a ." ...is about as strict as it can get, based on my quick read of the spec. And I'd be pretty happy with a regexp which does this, but I have no real clue how to write it. Any help appreciated. What would be great is a function which checks an email against the spec -- has anyone built such a beast? My friend also told me of a perl function which attempts to look-up the email address via the DNS MX records... has anyone attempted this in PHP??? Would there be any specific system requirements or limitations (email forwarders, etc) I'm really interested in getting this right, and posting it as an FAQ or article, rather than it kicking around in this group forever. Thanks, Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Email validation
There is a great function library on http://killersoft.com/ which was derived from what is widely considered the best email validation script in Perl. It also follows RFC 822 about as close as is possible. [http://www.faqs.org/rfcs/rfc822.html] I was about to start writing something simular, but decided not to re-invent the wheel... I've adopted this script on every project from now on, thanks to the kind person on this list who let me know about it! Justin French on 13/06/02 2:56 AM, Jeroen Timmers ([EMAIL PROTECTED]) wrote: > Is there a simple function that validate an email adres > > Thx > > Jeroen Timmers > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Email validation
> Can anyone tell me what the best form of Email validation > there is? It needs to be quick & as open to - and . as possible. We use this one on www.inww.com: Jason -- Jason Murray [EMAIL PROTECTED] Web Design Team, Melbourne IT Fetch the comfy chair! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Email validation
Hello Mike, On 21-Mar-01 01:21:13, you wrote: >Hello Again, >Can anyone tell me what the best form of Email validation there is? It needs >to be quick & as open to - and . as possible. Look here for a complete email validation class: http://phpclasses.UpperDesign.com/browse.html/package/13 Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED] -- E-mail: [EMAIL PROTECTED] URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]