Ciao a tutti, vi chiedo una delucidazione, ho trovato questo script per il whois su internet, ma non funziona e non capisco perche, quando inserisco un sito da controllare mi apre il popup, ma e' vuoto???
Questo e' il modulo che metto nell'index:
<form action="whois.php" metod="get">
www. <input type="text" name="word">
<input type="button" value="verifica">
</form>
e questo va nella pagina da chiamare:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>whois</title>
</head>
<body>
<?php
$domain=$word;
if($domain){
$whois_servers = array(
"it"=>"whois.nic.it",
"com"=>"rs.internic.net",
"info"=>"whois.afilias.net",
"net"=>"rs.internic.net",
"org"=>"rs.internic.net"
);
$parsedom = explode(".", $domain);
$host = $whois_servers[strtolower($parsedom[count($parsedom) - 1])];
if(empty($host)){
print "estensione dominio $domain non valida
";
}
else{
$fp = fsockopen($host, 43, &$errno, &$errstr, 10);
fputs($fp, "$domain\r\n");
while(!feof($fp)){
$row = fgets($fp,128);
$buf .= $row;
if(eregi("Whois Server:", $row))$server = trim(str_replace("Whois Server:", "", $row));
}
fclose($fp);
if(ereg("No match for", $buf)|| ereg("NOT FOUND", $buf) || ereg("No entries found in the IT-NIC database.",$buf)){
print "Il nome a dominio $domain sembra libero, vedi le informazioni in basso per dettagli
";
}
else{
print "Il nome a dominio $domain non sembra libero , Vedi le informazioni in basso per controllare
";
if($server){
print "$domain e’ registrato con $server:
";
print "<pre>";
$fp = fsockopen($server, 43, &$errno, &$errstr, 10);
fputs($fp, "$domain\r\n");
while(!feof($fp))print fgets($fp,128);
fclose($fp);
print "</pre>";
}
else{
print "<pre>$buf</pre>";
}
}
}
}
?>
</body>
</html>