All pastes #391894 Raw Edit

whois

public php v1 · immutable
·published 2007-03-12 14:41 UTC
rendered paste body
<?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 '<strong>PHP WHOIS 1.0 cheera edition</strong><br /><br />';echo "Using $whois to execute the query...<br /><br />";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 "<h2>Nem lehet regelni a $host.$tlds domaint!!! Mar foglalt!!!</h2>" . "\n";            echo '<br /><br /><strong>A kimenet:</strong><br /><br />';            $lines = explode("\n", $domain[1]);            foreach ($lines as $line) {                echo $line . '<br />' . "\n";        }        } else {            echo "<h2>A $host.$tlds szabadon regisztralhato</h2>" . "\n";        }    }}//end$endtime = getmicrotime();$deltat=($endtime - $starttime)*1000;echo '<br />Executed in ' . number_format($deltat, 2, '.', '') . ' millisecond' . "\n";include "inc/footer.inc";?>/*jail#cat inc/header.inc<?echo '<?xml version="1.0" encoding="utf-8" ?>' . "\n";echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n";echo '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">' . "\n";echo '<head>' . "\n";echo '<meta name="vim" content="xxx" />' . "\n";echo '<title>lix whois</title>' . "\n";echo '<link rel="stylesheet" type="text/css" media="screen" href="css/html.css" />' . "\n";echo '</head>' . "\n";echo '<body>' . "\n";?>jail#cat inc/form.inc<?echo '<form method="post">';echo '<input type="checkbox" name="tld[]" value="at" checked="checked" /> .at ';echo '<input type="checkbox" name="tld[]" value="com" /> .com';echo '<input type="checkbox" name="tld[]" value="org" /> .org';echo '<input type="checkbox" name="tld[]" value="net" /> .net';echo '<input type="checkbox" name="tld[]" value="hu" /> .hu';echo '<input type="checkbox" name="tld[]" value="be" /> .be';echo '<input type="checkbox" name="tld[]" value="de" /> .de';echo '<input type="checkbox" name="tld[]" value="sk" /> .sk <br /><br />';echo '<input type="text" name="domain" size="" /><br /><br /><input type="submit" name="domainq" value="Keres" /><br /><br />';echo '<input type="reset" value="Tiszta lap" name="reset1" />';echo '</form>';?>jail#cat inc/footer.inc<?echo '<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a></p>' . "\n";echo '</body>' . "\n";echo '</html>' . "\n";?>jail#*/