Ver Mensaje Individual
  #5 (permalink)  
Antiguo 13/01/2005, 00:33
Avatar de baklao
baklao
 
Fecha de Ingreso: noviembre-2004
Ubicación: Santa Ana - Isla de Margarita
Mensajes: 482
Antigüedad: 19 años, 5 meses
Puntos: 0
whois parte II

Pagina onlywhois.php
Código PHP:
<?
if ($action == "whois")
{
  
$target $domain.$ext;
 if(
strlen($domain)<3)
{
        
display("Please enter charecters with minimum length three");
         print <<<MSG
        <META HTTP-EQUIV=REFRESH CONTENT="2; URL=onlywhois.php">
MSG;
     exit;
}
if(
strlen($domain)>30)
{
        
display("Please enter charecters with maximum length thirty");
         print <<<MSG
        <META HTTP-EQUIV=REFRESH CONTENT="2; URL=onlywhois.php">
MSG;
     exit;
}
if(!
preg_match("/[a-zA-Z0-9]+/",$domain))
{
        
display("Please enter only alpha numberic charecters with alphabets and numbers only");
         print <<<MSG
        <META HTTP-EQUIV=REFRESH CONTENT="2; URL=onlywhois.php">
MSG;
     exit;
}
else
        {
  
whois ($target);
        }
}


function 
whois($target){
global 
$ntarget;
global 
$show;
$server "whois.crsnic.net";


if((
eregi(".com\$|.net\$|.edu\$"$target)) || (eregi(".com\$|.net\$|.edu\$"$ntarget)))
  
$server "whois.crsnic.net";
else if((
eregi(".info\$"$target)) || (eregi(".info\$"$ntarget)))
  
$server "whois.afilias.net";
else if((
eregi(".org\$"$target)) || (eregi(".org\$"$ntarget)))
  
$server "whois.corenic.net";
else if((
eregi(".name\$"$target)) || (eregi(".name\$"$ntarget)))
  
$server "whois.nic.name";
else if((
eregi(".biz\$"$target)) || (eregi(".biz\$"$ntarget)))
  
$server "whois.nic.biz";
else if((
eregi(".cc\$"$target)) || (eregi(".cc\$"$ntarget)))
  
$server "whois.enicregistrar.com";
else if((
eregi(".ws\$"$target)) || (eregi(".ws\$"$ntarget)))
  
$server "whois.nic.ws";
else if((
eregi(".au\$"$target)) || (eregi(".au\$"$ntarget)))
  
$server "whois.aunic.net";
else if((
eregi(".nz\$"$target)) || (eregi(".nz\$"$ntarget)))
  
$server "whois.domainz.net.nz";
 else{
  
$msg .= "I only support .com, .net, .org, .edu, .info,  .cc, .ws, and .biz.</blockquote>";
  
display($msg);
  return;
}


if (! 
$sock fsockopen($server43$num$error10)){
  unset(
$sock);
  
$msg .= "Timed-out connecting to $server (port 43)";
}
else{
  
fputs($sock"$target\n");
  while (!
feof($sock))
    
$buffer .= fgets($sock10240);
}
fclose($sock);
if(! 
eregi("Whois Server:"$buffer)){
   if(
eregi("no match"$buffer))
  {
   
display("NOT FOUND:No match for $target<br>");
   print <<<MSG
        <META HTTP-EQUIV=REFRESH CONTENT="3; URL=onlywhois.php">
MSG;
     exit;
 }

}
else{
   
$buffer split("\n"$buffer);
   for (
$i=0$i<sizeof($buffer); $i++){
     if (
eregi("Whois Server:"$buffer[$i]))
       
$buffer $buffer[$i];
   }
   
$nextServer substr($buffer17, (strlen($buffer)-17));
   
$nextServer str_replace("1:Whois Server:"""trim(rtrim($nextServer)));
   
$buffer "";

   if(! 
$sock fsockopen($nextServer43$num$error10)){
     unset(
$sock);
     
$msg .= "Timed-out connecting to $nextServer (port 43)";
   }
   else{
     
fputs($sock"$target\n");
     while (!
feof($sock))
       
$buffer .= fgets($sock10240);
     
fclose($sock);
   }
}
$msg .= nl2br($buffer);
$msg .= "</blockquote></p>";

 if (
$show == "1")
   {
display($msg);
exit;
 }
else
  {
?>
<script language="javascript">

function validate(form)
{
if(!form.domain.value.match(/[a-zA-Z0-9]+/))
 {
alert("Enter valid charecters and only alphanumeric charecters");
return false;
 }
 if(form.domain.value.length<3)
{
         alert("Enter charecters with minimum length three ");
        return false;
}
 if(form.domain.value.length>30)
{
         alert("Enter charecters with maximum length thirty");
        return false;
}
}
function popup(pagex){

        window.open(pagex,'Details','location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no,width=400,height=400')

}
</script>
<center>
<table cellpadding=1 cellspacing=1 border=0 width="50%"  bgcolor="#FF6600" >
        <tr><td  colspan="6" align="center" ><b><font face="Verdana,ARial,Helvetica" size="2" >View Domain Detail(s)</font></b></td></tr>
<tr>
<td bgcolor="white"  width="14%" >Domain</td>
<td bgcolor="white"   width="14%"></td>
</tr>

<tr bgcolor="white">
<td  width="14%"><font face="Verdana,Arial,Helvetica" size="2"><?echo $target;?></td>
<td  width="14%"><a href="onlywhois.php?action=whois&show=1&domain=<?=$target;?>" onClick="popup(this.href);return false;">Details</a></font></td>
</tr>
</table>
<center>
<?


  
}
}

function 
display($msg)

  {
?>
<center>
<table cellpadding=1 cellspacing=1 border=0 width="50%"  bgcolor="#FF6600" >
        <tr><td  colspan="6" align="center" ><b><font face="Verdana,ARial,Helvetica" size="2" >Message</font></b></td></tr>
<tr>
<td bgcolor="white"  width="14%" ><?=$msg;?></td></tr>

</table>
<center>
<?



  
}



?>
<script language="javascript">

function validate(form)
{
if(!form.domain.value.match(/[a-zA-Z0-9]+/))
 {
alert("Enter valid charecters and only alphanumeric charecters");
return false;
 }
 if(form.domain.value.length<3)
{
         alert("Enter charecters with minimum length three ");
        return false;
}
 if(form.domain.value.length>30)
{
         alert("Enter charecters with maximum length thirty");
        return false;
}
}
function popup(pagex){

        window.open(pagex,'Details','location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no,width=400,height=400')

}
</script>
<br><br><br><br><br>
<center>
<table cellpadding=1 cellspacing=1 border=0 width="50%"  bgcolor="#FF6600" >
        <tr><td  colspan="6" align="center" ><b><font face="Verdana,ARial,Helvetica" size="2" >Search Domain</font></b></td></tr>

<form method="POST" action="onlywhois.php" onSubmit="return validate(this);">
<input type="hidden" name="action" value="whois">
<tr>
<td bgcolor="white"  width="14%" >

<input type="text" name="domain" size="30" maxlength="63" value="">


<select name="ext">Select Extension
<option value=".cc">.com.au</option>
<option value=".cc">.com.nz</option>
<option value=".com">.com</option>
<option value=".net">.net</option>
<option value=".org">.org</option>
<option value=".biz">.biz</option>
<option value=".info">.info</option>
<option value=".ws">.ws</option>
<option value=".cc">.cc</option>

</select>
&nbsp;&nbsp;&nbsp;<input type="submit" name="button" value="whois">
</td>
</tr>
</form>
</table>
<table cellpadding=1 cellspacing=1 border=0 width="50%">
<tr><td align="right"><font style="font-size:8pt;font-family:Verdana,Tahoma;">Powered By : </font><a href="http://www.onlyphp.com" target="_blank" style="font-size:8pt;font-family:Verdana,Tahoma;">Only PHP</a></td></tr></table>
</center>
</center>
Suerte y salu2.

Por cierto cuenteme como les fue

Bye
__________________
Atte. Mohamed :aplauso: