set_magic_quotes_runtime(1);
include "inc/header.inc";
$whois="";
$tld='';
$host='';
function getmicrotime() {
$temparray = split(" ",microtime());
$returntime = $temparray[0] + $temparray[1];
return $returntime;
}
function syscall($command){
if ($proc = popen("($command)2>&1","r")){
while (!feof($proc)) $result .= fgets($proc, 1024);
pclose($proc);
return $result;
}
}
function wquery($tld,$host){
global $whois,$tld,$host;
if ($tld='com' or $tld='org' or $tld='net' or $tld='edu') {
$command="$whois $host.$tld";
} else {
$command="$whois -c $tld $host.$tld";
}
$command=escapeshellcmd($command);
$result=syscall($command,$result);
$findme = $host . '.' . $tld;
$findmeupper=strtoupper($findme);
$pos = strpos($result, $findme);
$posupper = strpos($result, $findmeupper);
if ($pos === false and $posupper === false) {
$exists=0;
} else {
$exists=1;
}
return(array($exists,$result));
}
$starttime = getmicrotime();
$whois=syscall('which whois',$whois);
echo 'PHP WHOIS 1.0 cheera edition
';
echo "Using $whois to execute the query...
";
include "inc/form.inc";
$tld = $_POST["tld"];
$host= $_POST["domain"];
if ($tld <> "") {
foreach ($tld as $tlds) {
$domain=wquery($tlds,$host);
if ($domain[0]=='1') {
echo "