Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/08/2011, 12:47
marvelous
 
Fecha de Ingreso: agosto-2011
Mensajes: 9
Antigüedad: 12 años, 9 meses
Puntos: 0
Mostrar dominio seleccionado en otra pagina

Hola que tal, eh estado utilizando un script en php para verificar dominios disponibles, cambiandole unas cosas y me ah funcionado excelente, el problema que tengo ahora es que el script me muestra los dominios que tengo configurado checar, por ejemplo el .com, .net, .com.mx, etc... y efectivamente los muestra bien, separados por un espacio, de esta manera:

http://img710.imageshack.us/img710/4410/screenpaz.jpg

Mi duda es como poder hacer que en los dominios que ya dicen "comprar" osea los disponibles pueda darle click en "comprar" y enviarme a otra pagina donde ya este ese dominio escrito, sin que el usuario tenga que escribirlo nuevamente. Aqui dejo el archivo descargable con los codigos ** http://dominioweb.com.mx/codigos/dominios.zip ** , mas que nada por si a alguien les llega a servir.

index.php
Código PHP:
<html>
<
head>
<
title>Jquery Easy Verificar si un dominio esta disponible con php y json</title>

<
link href="main.css" rel="stylesheet" />
<
script type="text/javascript" src="jquery-1.2.6.min.js"></script>

<script language="javascript">
$(document).ready(function() {
    
    var loading;
    var results;
    
    form = document.getElementById('form');
    loading = document.getElementById('loading');
    results = document.getElementById('results');
    
    $('#Submit').click( function() {
        
        if($('#Search').val() == "")
        {alert('Ingrese un dominio');return false;}
        
        results.style.display = 'none';
        $('#results').html('');
        loading.style.display = 'inline';
        
        $.post('process.php?domain=' + escape($('#Search').val()),{
        }, function(response){
            
            results.style.display = 'block';
            $('#results').html(unescape(response));    
            loading.style.display = 'none';
        });
        
        return false;
    });
    
});
</script>
</head>
<body>
<center>
  <form method="post" action="./" id="form"> 
<h3 style="color:#FFF">Ingrese solo el nombre del dominio (*sin prefijo .com, .org, etc)</h3>
        <input type="text" autocomplete="off" id="Search" name="domain"> 
        <input type="submit" id="Submit" value="Submit">
    
    </form>


    <div id="loading">Enviando datos....</div>
        
     <div id="results" style="width:420px; height:600px;" align="left">
        
     </div>    
 
 
 </center>
 </body>
 </html> 
process.php
Código PHP:
<?php
set_time_limit
(0);
ob_start();

########### Extensiones
$extensions = array(
    
'.com'         => array('whois.crsnic.net','No match for'),
    
'.net'         => array('whois.crsnic.net','No match for'),
    
'.com.mx'      => array('whois.nic.mx','Object_Not_Found'),        
    
'.mx'         => array('whois.nic.mx','Object_Not_Found'),
    
'.gob.mx'      => array('whois.nic.mx','Object_Not_Found'),    
    
    
);
###########

if(isset($_GET['domain']))
{
    
$domain str_replace(array('www.''http://','/'), NULL$_GET['domain']);
    
    if(
strlen($domain) > 0)
    {
        foreach(
$extensions as $extension => $who)
        {
            
$buffer NULL;
                
            
$sock fsockopen($who[0], 43) or die('Error Connecting To Server:' $server);
            
fputs($sock$domain.$extension "\r\n");
                
                while( !
feof($sock) )
                {
                      
$buffer .= fgets($sock,128);
                }
                
            
fclose($sock);
                            
            if(
eregi($who[1], $buffer))
            {
                echo 
'<h4 class="available"><span>Disponible</span>' $domain'<b>' $extension .'</b> Esta Disponible  - <a href="#">comprar</a></h4>';
            }
            else
            {
                echo 
'<h4 class="taken"><span>Tomado</span>' $domain '<b>' .$extension .'</b> Esta Tomado</h4>';
            }
            echo 
'<br />';    
            
            
ob_flush();
            
flush();
            
sleep(0.3);
            
        }
    }
    else
    {
        echo 
'Por favor ingrese nombre del dominio';
    }
}
?>
main.css
Código HTML:
body {
	font-family: Tahoma, sans-serif;
	font-size: 12px;
	font-weight: bold;
}
.cabecera{
     background: #4A3C31;
     border-bottom: 5px solid #69AD3C;
     margin:-8px 0 0 -8px;
     width: 100%;
	 }
.cabecera img{ 
     margin:40px 0 0 30px;
	 }
#loading {
	display: none;
}


#form {
	width:520px;
    background-color: #4A3C31;
    padding: 40px 50px 30px;
    margin: 10px 0;
    position: relative;
    border-radius: 15px;
    -moz-border-radius: 15px;
    -webkit-border-radius: 15px;
	-moz-border-radius:15px 15px 15px 15px;
	border:solid 5px #69AD3C;
}

#Search {
	border:medium none;
	color:#888888;
	float:left;
	font-family:Arial,Helvetica,Sans-serif;
	font-size:15px;
	height:36px;
	margin-right:12px;
	outline:medium none;
	padding:0 0 0 35px;
	text-shadow:1px 1px 0 white;
	width:425px;
}

#Submit {
	background:url("Search.png") no-repeat scroll 0 0 transparent;
	border:medium none;
	cursor:pointer;
	height:36px;
	overflow:hidden;
	text-indent:-999px;
	text-transform:uppercase;
	width:83px;
}

h4 {
	border:2px solid #EEEEEE;
	font:14px/1.3 Verdana,"Lucida Grande",Arial,Helvetica,Sans-Serif;
	margin:0px;
	padding:5px;
	min-width:120px;
	text-align:left
}

h4.taken span {
	background:none repeat scroll 0 0 #F08F78;
}
h4.taken:hover{
	background:none repeat scroll 0 0 #FFC5B7;
}

h4 a{font-family:"crete-rounded-web-1","crete-rounded-web-2",sans-serif; color:#333333}
 
h4 span {
	font-family:Verdana;
	font-size:12px;
	font-style:normal;
	margin-right:4px;
	padding:3px 5px;
}

h4.available:hover {
	background:none repeat scroll 0 0 #DDF2BC;
}
 h4.available span { background: #bce67b; }
 
y el javascript necesario: http://dominioweb.com.mx/codigos/jquery-1.2.6.min.js