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:
<?
if (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$",
$Email)) {
$error = 1;
$error_html .= "This email address is invalid: " . $Email;
echo $error_html;
}
?>
But this one looks quite impressive too:
<?
function checkaddress($mail) {
if ( !ereg( "^([0-9,a-z,A-Z]+) ([.,_]
([0-9,a-z,A-Z]+))*[@] ([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]
+))*[.]([0-9,a-z,A-Z]){2}([0-9,a-z,A-Z])?$", $mail ) ) {
return false;
}
else
{
return true;
}
}
?>
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]