Morning all!
SO i am using a user registry to a database and email validation is needed, the host is on the Windows platform so checkdnsrr() function is not possible. After reading various material i was able to obtain the following function which uses the nslookup available on windows:
function myCheckDNSRR($hostName, $recType = '')
{
if(!empty($hostName)) {
if( $recType == '' ) $recType = "MX";
exec("nslookup -type=$recType $hostName", $result);
// check each line to find the one that starts with the host
// name. If it exists then the function succeeded.
foreach ($result as $line) {
echo 'Line = '.$line.'<br>';
if(eregi("^$hostName",$line)) {
return true;
}
}
// otherwise there was no mail handler for the domain
return false;
}
return false;
}
The problem is that i get the following message when running the script:
Email = user.name@hotmail.com
username = user.name
domain = hotmail.com
Line = Server: mygateway.***
Line = Address: ***.***.*.*
Line =
Line = DNS request timed out.
Line = timeout was 2 seconds.
Line = DNS request timed out.
Line = timeout was 2 seconds.
Did not match a proper domain.
i have *'d out the server and address results, but they correspond to the gateway server and address of the hub computer on which the localhost is running off. Does anyone know what is going on here? How come it is not veryfying the actual inputted domain? And why is it timing out?
Thank you in advance for your help.