function checkEmail($email) { //check email format if (filter_var($email, FILTER_VALIDATE_EMAIL) == $email){ //check if the domain has MX entries $aux = explode('@',$email); return checkdnsrr($aux[1],'MX'); } return false; }
$email = $_POST['emailAddress']; //don't worry I am grabbing the e-mail address from a form and can display it $var = checkEmail($variable);
function checkEmail($email) { //check email format if (filter_var($email, FILTER_VALIDATE_EMAIL) == $email){ //check if the domain has MX entries $aux = explode('@',$email); return checkdnsrr($aux[1],'MX'); } return false; }
$email = $_POST['emailAddress']; //don't worry I am grabbing the e-mail address from a form and can display it $var = checkEmail($variable);
I am using the e-mail address of this@yahoo.com and that returns false
and using the e-mail address of aaa@aaa.com
What is $variable set to? And unless I'm not following correctly, the return false in the function should be wrapped in an else block. Plus there's no echo in your if statement.
Last edited by HDRebel88; 07-21-2012 at 06:00 AM..