Hello.
We are currently trying to get this domain WHOIS script working, however whenever it's submitted to from our form (also shown below) we just get a blank page.
Any ideas?
<?php
include_once('/home/us/header.php');
extract($_POST);
function whois($domain,$ext){
$url=$domain.$ext;
switch($ext){
case ".com":
$whois = "whois.networksolutions.com";
break;
case ".org":
$whois = "whois.publicinterestregistry.net";
break;
case ".net":
$whois = "whois.networksolutions.com";
break;
case ".co.uk":
$whois = "whois.nic.uk";
break;
case ".org.uk":
$whois = "whois.nic.uk";
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 "<code>\r\n";
while (!feof($f)) {
echo fread($f,128);
}
print "</code>";
fclose($f);
}
}else{
echo "Invalid domain entered.";
}
}
include_once('/home/us/footer.php');
?>
and the form:
<form method="post" action="/whois.php">
Domain:</strong> ([url]http://www.[/url]) <input type="text" name="domain" size="10" />
<select name="ext">
<option value=".com">.com</option>
<option value=".org">.org</option>
<option value=".net">.net</option>
<option value=".co.uk">.co.uk</option>
<option value=".org.uk">.org.uk</option>
<option value=".biz">.biz</option>
</select>
<input type="submit" name="submit" value="Search" />
</form>
Many thanks!
Regards,