Page 1 of 1

[SOLVED] Using checkdnsrr() for MX record

Posted: Sun Oct 15, 2006 1:58 am
by tristanlee85
I'm just starting something very basic to test a few things. Here is my code:

Code: Select all

<?php

// Get the posted vars
$domain = $_POST['domain'];
if (isset($domain) && $domain != NULL)
{
	if (checkdnsrr($domain,"MX"))
	{
		echo "The domain already exists";
		echo "<br />" . $domain;
	}
	else
	{
		echo "You can purchase this domain";
		echo "<br />" . $domain;
	}
}
?>

<html>
<head></head>
<body>
<form action="?" method="post">
<input type="text" name="domain" size="50">
<input type="submit" value="Check domain">
</form>
</body>
</html>
No matter what I try, it returns false and says "You can purchase this domain". Is there something I am doing wrong? All of the other examples I've seen do this.

Posted: Sun Oct 15, 2006 2:41 am
by tristanlee85
Fixed. I guess using the 'ANY' type did the trick.