function doWhois($domain) {
$fp = fsockopen("rs.internic.net", 43, $errno, $errstr, 10); //connect to whois database
if (!$fp) {
//error
echo $errstr;
} else {
fputs ($fp, "".$domain."\r\n"); //check domain
$data = null;
while(!feof($fp)) {
$buf = fgets($fp,128);
$data .= $buf;
}
$data = str_replace("\n","<br>",$data);
}
fclose($fp);
return $data;
}
echo doWhois('domain.com'); //have your domain here
A modified version out of a whois class i made it works just change 'domain.com ' to the domain needed. You probably wont it to be from a form.