checkdnsrr not working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
patch2112
Forum Commoner
Posts: 86
Joined: Sun Oct 31, 2004 9:44 am
Location: London

checkdnsrr not working

Post by patch2112 »

Hello all,

Has anyone ever heard of checkdnsrr not working for some reason? I have a simple validation script that works fine on my VPS, but validates any email address on my clients shared plan (linux).

Code: Select all

<?
function validate_email($email){
if(checkdnsrr(array_pop(explode("@",$email)),"MX")) { return true; }
else { return false; }
}

$email = "junk@jklasfdjklasfdjfjklsadfjklasdji.com";
if (validate_email($email)) { echo "passed"; } else { echo "failed"; }
//returns "passed"
?>
Thanks,
Philip
Post Reply