Jump to content

Domain Checker


podja

Recommended Posts

[quote author=podja link=topic=119643.msg490296#msg490296 date=1166815089]
I only want to check if the domain name is available or not. I do not need all the WhoIs info. thanks anyway![/quote]

I guess I have to point out the obvious. If you were to use the whois code and data is returned you could assume the domain is taken - you don't have to display the returned data.
Link to comment
https://forums.phpfreaks.com/topic/31598-domain-checker/#findComment-146582
Share on other sites

[code]

<?php
/*Simply place the code whois($domain,$ext); in any page and create a form with the fields domain and extension. A sample is listed below. You could add the whois($domain,$ext); to the bottom of this script and point a form to it and you will get the whois results. Please not the http://www. is not required.
*/
/*Form example:
<form action="http://mydomain.com/whois.php" method="post">Domain:(http://www.)<input type="text" name="domain"><br>Extension:&nbsp;
<select name="ext">
<option value=".co.uk">.co.uk</option>
<option value=".com">.com</option>
<option value=".biz">.biz</option>
<option value=".fr">.fr</option>
<selected>Please choose one..</selected>
</select>
<br><input type="submit" name="submit" value="look-up">
</form>
*/
extract($_POST);
function whois($domain,$ext){
$url=$domain.$ext;
switch($ext){
case ".co.uk":
$whois = "whois.nic.uk";
break;
case ".com":
$whois = "whois.networksolutions.com";
break;
case ".fr":
$whois = "whois.nic.fr";
break;
case ".biz":
$whois = "whois.biz";
break;
default:
$whois = "whois.networksolutions.com";
}
if (trim($url) <> "") {
  $url = trim($url);
$f = fsockopen($whois, 43, $errno, $errstr, 30);
  if (!$f) {
     echo "Connection To Server Failed ($errno)";
  } else {
     fputs($f, "$url\r\n");
     print "<pre>\r\n";
   while (!feof($f)) {
        echo fread($f,128);
     }
    print "</pre>";
     fclose($f);
  }
}else{
echo "Invalid domain entered";
}
}
?>

[/code]
Link to comment
https://forums.phpfreaks.com/topic/31598-domain-checker/#findComment-146799
Share on other sites

[quote author=michaellunsford link=topic=119643.msg490412#msg490412 date=1166833676]
Hmmm... whois used to have a disclaimer. It went something like, lack of a record does not necessarily guarantee domain name availability. Has that changed recently?[/quote]

I'm sure it hasn't, but I have yet to find a domain availability page that was 100% accurate.
Link to comment
https://forums.phpfreaks.com/topic/31598-domain-checker/#findComment-147052
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.