Page 1 of 1

WHOIS database

Posted: Wed Aug 07, 2002 5:57 am
by parms
I want to make a php interface that can search the WHOIS database for .com names and .co.uk names.

Is this easy to do and if so how do i go about it beacause i havnt a clue.

Please help :roll:

Posted: Wed Aug 07, 2002 8:45 am
by darkshine
ok that one works with Network solution
[syntax=php]function NS_whois($domain){
if (trim($domain) <> "") {
$domain = trim($domain);
$fp = fsockopen("whois.networksolutions.com", 43, $errno, $errstr, 30);
if (!$fp) {
return "$errstr ($errno)";
} else {
fputs($fp, "$domain\r\n");
$return = "";
while (!feof($fp)) {
$return .= fread($fp, 128);
}
fclose ($fp);
return $return
}
}

}[/syntax]

Posted: Wed Aug 07, 2002 8:49 am
by darkshine
use an array for only selecting the omains u want :

'com'=>'whois.internic.com'
'uk'=>'whois.nic.uk'