Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/09/2004, 11:37
Avatar de JuanKa
JuanKa
 
Fecha de Ingreso: septiembre-2004
Mensajes: 468
Antigüedad: 19 años, 7 meses
Puntos: 1
Este es el codigo del formulario
<form method="POST" action= "whois_dominio.php">
<table width="299" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<th width="299" scope="col"><div align="center">
<INPUT name="dominio" SIZE="30" MAXLENGTH="35">
.
<select name="ext" id="select">
<option value="todos">Todos</option>
<option value="com">com</option>
<option value="net">net</option>
<option value="org">org</option>
<option value="edu">edu</option>
<option value="biz">biz</option>
<option value="info">info</option>
</select>
</div></th>
</tr>
<tr>
<td><div align="center">
<INPUT name="SUBMIT" TYPE="SUBMIT" VALUE="Buscar">
....
<input type="reset" name="Submit" value="Borrar">
</div></td>
</tr>
</table>
</FORM>
********************************************
Bueno este es codigo donde me verifica.... es muy largo... pero... bueno

He copiado cuando selecciono todos en la lista "Todos y .com" el resto todo sale bien

donde iria la parte donde tu me dices....


<?php
function checkDomainReg($domain,$server)
{
if(!$server)
{
$server = 'whois.crsnic.net';
$lineNumber = 8;
$fp = fsockopen ($server, 43, &$errnr, &$errstr) or die("$errno: $errstr");
fputs($fp, "$domain\n");
while (!feof($fp))
{
$serverReturn = fgets($fp, 2048);
$x++;
if ($x == $lineNumber)
{ $line = $serverReturn; }
}
fclose($fp);
$token = strtok("$line"," ");

if ($token == 'No')
{ $result = 0; }
else
{$result = 1; }
return $result;
}
else
{
$lineNumber = 8;
$fp = fsockopen ($server, 43, &$errnr, &$errstr) or die("$errno: $errstr");
fputs($fp, "$domain\n");
while (!feof($fp))
{ $serverReturn .= fgets($fp, 2048); }

if (substr_count($serverReturn,'NOT FOUND'))
{ $result = 0; }
else
{ $result = 1; }
return $result;
}

}

//********************************************** FIN DE FUNCION ************************************************
$var_dominio=$_POST['dominio'];
$var_extension=$_POST['ext'];

//echo $var_dominio.'<br>';
//echo $var_extension.'<br>';
$punto=".";
$union='www.'.$var_dominio.$punto;
switch($var_extension)
{
case "todos":
{
echo '<table width="372" border="0" align="center" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<th width="170" scope="col">Dominio</th>';
echo '<th width="71" scope="col">Estado</th>';
echo '<th width="52" scope="col">Whois</th>';
echo '<th width="79" scope="col">Comprar</th>';
echo '</tr>';

if(checkDomainReg("$dominio.com",''))
{
echo '<tr>';
echo '<td><div align="center">'.$union.'com'.'</div></td>';

echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';
// echo "$dominio.com esta registrado<br>";
}
else
{
echo '<tr>';
echo '<td><div align="center">'.$union.'com'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';
// echo "$dominio.com esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
//************************************************** ********************************
if(checkDomainReg("$dominio.net",''))
{
echo '<tr>';
echo '<td><div align="center">'.$union.'net'.'</div></td>';
echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';

// echo "$dominio.net esta registrado<br>";
}
else
{
echo '<tr>';
echo '<td><div align="center">'.$union.'net'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';

// echo "$dominio.net esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
//************************************************** ********************************
if(checkDomainReg("$dominio.org",'whois.pir.org'))
{
echo '<tr>';
echo '<td><div align="center">'.$union.'org'.'</div></td>';
echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';

// echo "$dominio.org esta registrado<br>";
}
else
{
echo '<tr>';
echo '<td><div align="center">'.$union.'org'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';

// echo "$dominio.org esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
//************************************************** ********************************
if(checkDomainReg("$dominio.edu",'whois.internic.n et'))
{
echo '<tr>';
echo '<td><div align="center">'.$union.'edu'.'</div></td>';
echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';

// echo "$dominio.edu esta registrado<br>";
}
else
{
echo '<tr>';
echo '<td><div align="center">'.$union.'edu'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';

// echo "$dominio.edu esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
//************************************************** ********************************
if(checkDomainReg("$dominio.biz",'whois.nic.biz'))
{
echo '<tr>';
echo '<td><div align="center">'.$union.'biz'.'</div></td>';
echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';

// echo "$dominio.biz esta registrado<br>";
}
else
{
echo '<tr>';
echo '<td><div align="center">'.$union.'biz'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';

// echo "$dominio.biz esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
//************************************************** ********************************
if(checkDomainReg("$dominio.info",'whois.afilias.n et'))
{
echo '<tr>';
echo '<td><div align="center">'.$union.'info'.'</div></td>';
echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';

// echo "$dominio.info esta registrado<br>";
}
else
{
echo '<tr>';
echo '<td><div align="center">'.$union.'info'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';

// echo "$dominio.info esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
//************************************************** ********************************
echo '</table>';
break;
}

case "com":
{
if(checkDomainReg("$dominio.com",''))
{
echo '<table width="372" border="0" align="center" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<th width="170" scope="col">Dominio</th>';
echo '<th width="71" scope="col">Estado</th>';
echo '<th width="52" scope="col">Whois</th>';
echo '<th width="79" scope="col">Comprar</th>';
echo '</tr>';

echo '<tr>';
echo '<td><div align="center">'.$union.'com'.'</div></td>';
echo '<td><div align="center">Registrado</div></td>';
echo '<td><div align="center">Ver</div></td>';
echo '<td><div align="center">----</div></td>';
echo '</tr>';
echo '</table>';
// echo "$dominio.com esta registrado<br>";
}

else
{
echo '<table width="372" border="0" align="center" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<th width="170" scope="col">Dominio</th>';
echo '<th width="71" scope="col">Estado</th>';
echo '<th width="52" scope="col">Whois</th>';
echo '<th width="79" scope="col">Comprar</th>';
echo '</tr>';

echo '<tr>';
echo '<td><div align="center">'.$union.'com'.'</div></td>';
echo '<td><div align="center">Libre</div></td>';
echo '<td><div align="center">----</div></td>';
echo '<td><div align="center">Si</div></td>';
echo '</tr>';
echo '</table>';


// echo "$dominio.com esta disponible. ¿Desea registrarlo ahora mismo?<br>";
}
break;
}
}

Gracias Amigo de antemano....
Estare muy agradecido....