Re: email varification
| From: | Wico de Leeuw | Date: | Tue, 17 Oct 2000 09:28:05 +0000 |
| Subject: | Re: email varification | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-20583@lists.php.net to get a copy of this message | ||
Hiya
function Validate_Domain ($domain) {
return(preg_match("'^(?:[a-z_0-9-]+[\.]{1})*(?:[a-z_0-9-]+\.)[a-z]{2,3}$'i", $domain));
}
function Validate_Email ($email) {
return(preg_match("'^[a-z0-9_.=-]+@(?:[a-z0-9-]+\.)+([a-z]{2,3})\$'i", $email));
}
function Validate_Url ($url) {
return(preg_match("'^[^:]+://(?:[a-z_0-9-]+[\.]{1})*(?:[a-z_0-9-]+\.)[a-z]{2,3}.*$'i", $url));
}
P.S. Could someone put these functions I created in a FAQ or something this is the 10th time i put those on the list for someone asking
Greetz,
Wico
At 03:55 17-10-00 -0700, Dallas Kropka wrote:
this code is returning 1 (ie bad email) for any email.... any idea why? Id dosent seem to ever go into the first if statement. if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$",$emailaddress, $check)){ if ( getmxrr(substr(strstr($check[0], '@'), 1), $validate_email_temp)) { return 0; }else { return 1; } }else { return 1; }it seems to get into the statement, then proceds to the first else when the email is "really" good, and the second else when it is bad.... but the if (getmx....... never gets evaluated, could someone please help ?