Web Hosting Talk







View Full Version : PHP Domain Availability Checking


SynHost
11-15-2002, 06:23 PM
Hello -

I've searched around the forum looking for what I am trying to accomplish but I'm not having much luck. Basically I just need some code that will tell me if a domain has been registered or if it is free for registration for the following extensions:

.com, .net, .org, .ws, .info, .biz, and .us would be nice too.

If you know of just a simple function or have some code for me to accomplish this I would be most greatful.

Thanks much!
Ben Hughes

:: paVel ::
11-15-2002, 06:32 PM
Hello,

We use WhoIS script from www.mattsscripts.co.uk

--------------------

Matt's Whois is a professional domain name whois query script written to allow visitors to a website to quickly and reliably check the status of almost any top level domain. Many websites are already using this script for their whois lookups, why don't you?
This script also contains a fully configurable and customizable template system where by the script can seemlessly integrate into the existing website, bundle this with the ability to query about 270 different top level domains and the quality of a commercial product shows exactly why Matt's Whois is being used by more web sites every single day!
There have been quite a few changes to Matt's Whois recently involving a few movements within the template system meaning that any existing templates will require a bit of a "juggle" (e-mail me for help on this!), so other templates that can be used are available for download just below, simply extract them into a sub-directory in the same directory as the main script (either mwhois.cgi or mwhois.php). There is an administration script included for (hopefully) easy configuration of the various sections. Both versions of the script come bundles and configured with the default english templates.

--------------------

SynHost
11-15-2002, 10:53 PM
Hi -

Thanks for the reply but I'm not looking for anything with a GUI - I'll be writing my own interface and I just need a function or some code I can use to check to see if one is registered for a variety of extensions.

Ben

Novicane
11-16-2002, 03:56 AM
http://www.icewalkers.com/doclib/howtos/PHP-HOWTO-28.html

// domain is like "phpwizard.net"
function whois($domain, $server="whois.internic.net")
{
$fp = fsockopen ($server, 43, &$errnr, &$errstr) or die("$errno: $errstr");
fputs($fp, "$domain\n");
while (!feof($fp))
echo fgets($fp, 2048);
fclose($fp);
}

You could probably use a eregi() and check for availability.

achost_ca
11-16-2002, 05:50 AM
there are several php whois classes floating around, hotscripts.com is sure to have at least one.

ThomasC
11-17-2002, 04:01 PM
http://www.sloppycode.net/sloppycode/PHP/cm16.html

:)