I'm trying to add DNS MX validation and I must be missing something, because I can't get it to work...
In the common-validator.php file after line 28, I added the following...
//validate DNS MX record
function domain_exists($value) {
list($user,$domain) = split('@',$value);
if (!checkdnsrr($domain,'MX')) {
return 'Sorry, This domain is not valid';
} else {
return true;
}
}
And in my post-functions.php file I added the following after $rules[$element_name]['email'] = true; on line 296 since I only want to do this on certain forms:
if ($form_id == '3') {
$rules[$element_name]['domain_exists'] = true;
}
Any help would be appreciated.