I need a little assistance to complete my code. I want to check for the mx record of an email address from a form on my website and if the email address is hosted by google apps then I want the page to redirect to a different page than where other emails redirect to.
I know I can check for the mx record either using dns_get_record, checkdnsrr or getmxrr() but I don't know how to complete the code.
$email = $_POST['email'];<br>
$domain = substr(strrchr($email, "@"), 1);<br>
$mx = dns_get_record('$domain', DNS_MX, );
This is where I get stuck. How would I implement this in php: if $mx includes [url removed, login to view] redirect to [url removed, login to view]
This is not a duplicate question. I am trying to use php to redirect to a new page based on the mx record of the email address. The mx record query should locate [url removed, login to view] and then redirect based on that but if mx record doesnt contain [url removed, login to view] it should redirect to a different page.
More details about this project can be found here
[url removed, login to view]