Zend - The PHP Company




Miscellaneous

Add Code


phpindowhois ( update! )  

Type: code fragment
Added by: idban
Entered: 02/05/2000
Last modified: 07/12/2001
Rating: **** (5 votes)
Views: 8550
whois on indonesian domain, our nic isnt open but they have CGI,
so i use php to praser their CGI output :)

this is update version, they change
http://whois.idnic.net.id/cgi-bin/whois-cgi
to
http://whois.idnic.net.id/cgi-bin/whois.cgi

please update your indo domain lookup!


<? 
/*
 whois on indonesian domain, our nic isnt open but they have CGI, 
so i use php to praser their CGI output :)
for  mr. maman on idnic sorry if your server got hitted :) 

idban secandri 2000 
http://php.klik.or.id
*/
?> 
<?
//------------------------------- old version  ( begin )
?>
<body text="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#ff0000">
<form method="POST" action="<? echo $PHP_SELF?>"> 
Enter Domain name: <br><input type="text" value="<?if (!$lookup) {echo"";} else echo"$lookup";?>" name="lookup"><br>
Domain name select domain type: <br>
<input type="radio" name="dom" value=".co.id">co.id</option> ( company )<br>
<input type="radio" name="dom" value=".net.id">net.id</option> ( network/ISP )<br>
<input type="radio" name="dom" value=".web.id">web.id</option> ( public services )<br>
<input type="radio" name="dom" value=".or.id">or.id</option> ( organization )<br>
<input type="radio" name="dom" value=".mil.id">mil.id</option> ( military )<br>
<input type="radio" name="dom" value=".ac.id">ac.id</option> ( academic )<br>
<input type="hidden" name="ns" value="idnic"></option><br>
<input type="submit" value="lookup them now!"> 
</form> 

<? 
$lookup2 
="$lookup$dom";
if(
$REQUEST_METHOD == "POST"){ 
echo 
"<hr noshade size=1>n"
echo 
"<h3>Results for $lookup2</h3>n"
echo 
"<pre>n";
if (
$ns=="idnic"){ 
$file=fopen("http://whois.idnic.net.id/cgi-bin/whois-cgi?user=$lookup2","r");
if (!
$file) {
    echo 
"error when connectn";
    exit;
    }
 while (!
feof($file)) {
  echo 
fgets($file16384); 
   }
  echo 
"<hr noshade size=1>n"
  echo 
"powered by phpindowhois &copy; <a href="mailto:idban@satunet.com">idban secandri</a> 2000<br>";
  echo 
"<hr noshade size=1>n"
  echo 
"the code? just click here!!n"
  
fclose($file);
}
}
?>
<?
//------------------------------- old version  ( end )
?>
 
<?
//----------new version ( begin )
?>
<body text="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#ff0000"><form method="POST" action="<? echo $PHP_SELF?>"> 
Enter Domain name: <br><input type="text" value="<?if (!$lookup) {echo"";} else echo"$lookup";?>" name="lookup"><br>
Domain name select domain type: <br>
<input type="radio" name="dom" value="co.id">co.id</option> ( company )<br>
<input type="radio" name="dom" value="net.id">net.id</option> ( network/ISP )<br>
<input type="radio" name="dom" value="web.id">web.id</option> ( public services )<br>
<input type="radio" name="dom" value="or.id">or.id</option> ( organization )<br>
<input type="radio" name="dom" value="mil.id">mil.id</option> ( military )<br>
<input type="radio" name="dom" value="ac.id">ac.id</option> ( academic )<br>
<input type="hidden" name="ns" value="idnic"></option><br>
<input type="submit" value="lookup them now!"> 
</form> 
<? 
$lookup2
str_replace(".","",$lookup); 
if(
$REQUEST_METHOD == "POST"){ 
echo 
"<hr noshade size=1>n"
echo 
"<h3>Results for $lookup2</h3>n"
echo 
"<pre>n";
if (
$ns=="idnic"){ 
     
$fp fsockopen("whois.idnic.net.id"80, &$errno, &$errstr30); 
            if(!
$fp) { 
                echo 
"whois.idnic.net.id site down!!<br>n"
                exit; 
            } else { 
$file=fopen("http://whois.idnic.net.id/cgi-bin/whois.cgi?domain=$lookup2&induk=$dom","r");
if (!
$file) {
    echo 
"error when connectn";
    exit;
    }
 while (!
feof($file)) {
  echo 
fgets($file16384); 
   }
  echo 
"<hr noshade size=1>n"
  echo 
"powered by phpindowhois &copy; <a href="mailto:idban@satunet.com">idban secandri</a> 2000<br>";
  echo 
"<hr noshade size=1>n"
  echo 
"the code? <a href="http://www.zend.com/codex.php?id=142&single=1">just click here!!</a>n"; 
  
fclose($file);
}
}
}
?> 
<?
//----------new version ( end )
?>


Usage Example


See the example


Rate This Script





Search



This Category All Categories