mbrown Posted February 8, 2009 Share Posted February 8, 2009 list($emailusername,$domain)=split('@',$email); if(!checkdnsrr($domain, 'MX')) { $errorMessage .= "<br />The domain entered, $domain, does not have a valid mail server"; } Error Message: Fatal error: Call to undefined function checkdnsrr() in C:\xampp\htdocs\seniorProject\register\validation.php on line 125 Server is running off of Windows Vista SP1 x64 with XAMPP Quote Link to comment https://forums.phpfreaks.com/topic/144402-checkdnsrr-error/ Share on other sites More sharing options...
btherl Posted February 9, 2009 Share Posted February 9, 2009 The function was available in windows from php 5.3.0. If your php is older than that, you can use the pear package Net_DNS. Details are in the manual: checkdnsrr() Quote Link to comment https://forums.phpfreaks.com/topic/144402-checkdnsrr-error/#findComment-757820 Share on other sites More sharing options...
mbrown Posted February 12, 2009 Author Share Posted February 12, 2009 I am using 5.2.8. I am using xampp so it is for a linux distro. I do not see any other version of php other than the version i have on their site. Quote Link to comment https://forums.phpfreaks.com/topic/144402-checkdnsrr-error/#findComment-760640 Share on other sites More sharing options...
premiso Posted February 12, 2009 Share Posted February 12, 2009 It maybe for a linux distro, but versions before 5.3 did not have the right functionality of that function for windows, unfortunately. function win_checkdnsrr($host, $type='MX') { if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { return; } if (empty($host)) { return; } $types=array('A', 'MX', 'NS', 'SOA', 'PTR', 'CNAME', 'AAAA', 'A6', 'SRV', 'NAPTR', 'TXT', 'ANY'); if (!in_array($type,$types)) { user_error("checkdnsrr() Type '$type' not supported", E_USER_WARNING); return; } @exec('nslookup -type='.$type.' '.escapeshellcmd($host), $output); foreach($output as $line){ if (preg_match('/^'.$host.'/',$line)) { return true; } } } There is some code you can use in place of checkdnsrr for Windows. Quote Link to comment https://forums.phpfreaks.com/topic/144402-checkdnsrr-error/#findComment-760648 Share on other sites More sharing options...
mbrown Posted February 14, 2009 Author Share Posted February 14, 2009 premiso, so i can use taht function/ Quote Link to comment https://forums.phpfreaks.com/topic/144402-checkdnsrr-error/#findComment-762313 Share on other sites More sharing options...
premiso Posted February 14, 2009 Share Posted February 14, 2009 premiso, so i can use taht function/ ummm.....yes? Quote Link to comment https://forums.phpfreaks.com/topic/144402-checkdnsrr-error/#findComment-762332 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.