Forum Moderators: coopster

Message Too Old, No Replies

how to validate Email Form

         

Shanee

11:32 am on Jul 31, 2006 (gmt 0)

10+ Year Member



hello... mates
i have an question to know how to validate email form
I.E

i have email Subscription php script (created by me) but sometime the users enter invalid email address.. that why i want to know, how to validate $email variable.

Thanks

omtias

1:02 pm on Jul 31, 2006 (gmt 0)

10+ Year Member



there's alot free email validation script usin php...
i found this somewhere...

<?PHP

// İyi Şanslar / Good Luck :)

function is_email($eposta)
{
if(!eregi('^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$', $eposta))
{
// Eğer E-Posta Adresi x@x.xx Formatında değilse False (yanlış) Sonucu dönecektir...
//Not E-Mail Format x@x.xx ...
return false;
}
else
{
list($account, $domain) = split("@", $eposta);
// Önemli checkdnsrr() Fonksiyonu Windows sunucularda yoktur...
// checkdnsrr() Fonction is Not Windows Server... Only Linux...
if (checkdnsrr($domain, "MX"))
{
// Eğer domain adresine bağlı MX (Mail) sunucusu var ise sonuç True (doğru) döner...
//is Domain MX server true...
return true;
}
else
{
// Eğer domain adresine bağlı bir MX sunucusu yok ise sonuç False Döner...
//not Domain Mx Server
return false;
};
};
};

?>

[edited by: dreamcatcher at 2:22 pm (utc) on July 31, 2006]
[edit reason]
[1][edit reason] No urls as per TOS [webmasterworld.com] Thanks. [/edit]
[/edit][/1]