Foros del Web » Programando para Internet » PHP »

Insertar Link en MaxWHois (PHP)

Estas en el tema de Insertar Link en MaxWHois (PHP) en el foro de PHP en Foros del Web. Buenas noches, estoy configurando el Max's Whois y quisiera saber si puedo hacer que el "DISPONIBLE" sea un link par mi formulario de contacto: "contacto.html", ...
  #1 (permalink)  
Antiguo 18/04/2012, 22:46
Avatar de sarumanice  
Fecha de Ingreso: mayo-2008
Ubicación: Lima, Peru
Mensajes: 103
Antigüedad: 15 años, 11 meses
Puntos: 4
Insertar Link en MaxWHois (PHP)

Buenas noches, estoy configurando el Max's Whois y quisiera saber si puedo hacer que el "DISPONIBLE" sea un link par mi formulario de contacto: "contacto.html", el whois esta dentro de una carpeta whois asi que el enlace seria "../contacto.html" trate de hacerlo con el <a href ="../contacto.html">DISPONIBLE</a> pero me sale error. Alguien me ayuda como hacerlo? Solo es temporal hasta comprar la licencia de WHMCS

Este es un fragmento del codigo. Gracias.


Código PHP:
function showDomainResult($domain,$server,$findText){
   if (
$this->tr == 0){
       
$this->tr 1;
       
$class " class='tr2'";
   } else {
       
$this->tr 0;
       
$class "";
   }
   if (
$this->checkDomain($domain,$server,$findText)){
      echo 
"<tr $class><td>$domain</td><td class='ava'>DISPONIBLE</td></tr>";
   }
   else echo 
"<tr $class><td>$domain</td><td class='tak'>NO DISPONIBLE</td></tr>";

Aqui el codigo completo:

Código PHP:
<?php
/*************************************************
 * Max's Whois
 *
 * Version: 1.0
 * Date: 2007-11-28
 *
 ****************************************************/

class maxWhois{

    var 
$serverList;
    var 
$tr 0;
    
function 
maxWhois(){   
    
$this->serverList[0]['top']      = 'com';
    
$this->serverList[0]['server']   = 'whois.crsnic.net';
    
$this->serverList[0]['response'] = 'No match for';
    
$this->serverList[0]['check']    = true;
    
    
$this->serverList[1]['top']      = 'net';
    
$this->serverList[1]['server']   = 'whois.crsnic.net';
    
$this->serverList[1]['response'] = 'No match for';
    
$this->serverList[1]['check']    = false;

    
$this->serverList[2]['top']      = 'org';
    
$this->serverList[2]['server']   = 'whois.publicinterestregistry.net';
    
$this->serverList[2]['response'] = 'NOT FOUND';
    
$this->serverList[2]['check']    = false;
    
    
$this->serverList[3]['top']      = 'info';
    
$this->serverList[3]['server']   = 'whois.afilias.net';
    
$this->serverList[3]['response'] = 'NOT FOUND';
    
$this->serverList[3]['check']    = false;
    
    
$this->serverList[4]['top']      = 'name';
    
$this->serverList[4]['server']   = 'whois.nic.name';
    
$this->serverList[4]['response'] = 'No match';
    
$this->serverList[4]['check']    = false;
    
    
$this->serverList[5]['top']      = 'us';
    
$this->serverList[5]['server']   = 'whois.nic.us';
    
$this->serverList[5]['response'] = 'Not found:';
    
$this->serverList[5]['check']    = false;

    
$this->serverList[6]['top']      = 'biz';
    
$this->serverList[6]['server']   = 'whois.nic.biz';
    
$this->serverList[6]['response'] = 'Not found';
    
$this->serverList[6]['check']    = false;
    
    
$this->serverList[7]['top']      = 'ca';
    
$this->serverList[7]['server']   = 'whois.cira.ca';
    
$this->serverList[7]['response'] = 'AVAIL';
    
$this->serverList[7]['check']    = false;

    
$this->serverList[8]['top']      = 'tv';
    
$this->serverList[8]['server']   = 'whois.internic.net';
    
$this->serverList[8]['response'] = 'No match for';
    
$this->serverList[8]['check']    = false;
}

function 
showHeader(){
?>
    <div id="container">
        <div id="header"><div id="header_left"></div>
        <div id="header_main">Registre su Dominio</div><div id="header_right"></div></div>
        <div id="content">
<?php
}

function 
showWhoisForm(){
?>
            <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" >
                <table class="dtable2">
                <tr><th colspan="5">Ingrese el nombre de Dominio:</th></tr>
                <tr><td colspan="5"><center>www.<input name="domain" type="text" size="35" /></center></td></tr>
                <tr><th colspan="5">Selecccione la extencion:</th></tr>
                <tr>
            <?php
                $i 
0;
                foreach (
$this->serverList as $value) {
                    if (
$value['check'] == true$checked=" checked ";
                    else 
$checked " ";
                    
                    echo 
'<td><input type="checkbox" name="top_'.$value['top'].'"'.$checked.'/>.'.$value['top'].'</td>';
                    
$i++;                    
                    if (
$i 4) {
                        
$i 0;
                        echo 
'</tr><tr>';
                    }
                }
                
            
?>                
                </tr>
                </table>
                <center><input type="submit" name="submitBtn" class="sbtn" value="Buscar" /></center>
            </form>
<?php
}

function 
showFooter(){
?>
        </div>
    </div>

<?php
}

function 
processWhois(){
    
$this->showHeader();

    if (!isset(
$_POST['submitBtn'])){
        
$this->showWhoisForm();
    } else {

        
$domainName = (isset($_POST['domain'])) ? $_POST['domain'] : '';
        
           for (
$i 0$i sizeof($this->serverList); $i++) {
               
$actTop "top_".$this->serverList[$i]['top'];
               
$this->serverList[$i]['check'] = isset($_POST[$actTop]) ? true false;
           }

        
// Check domains only if the base name is big enough
        
if (strlen($domainName)>2){
            echo 
'<table class="dtable">';
            echo 
'<tr><th colspan="2">Dominios</th></tr>';
        
               for (
$i 0$i sizeof($this->serverList); $i++) {
                   if (
$this->serverList[$i]['check']){
                     
$this->showDomainResult($domainName.".".$this->serverList[$i]['top'],
                                             
$this->serverList[$i]['server'],
                                             
$this->serverList[$i]['response']);
                }
            }
        
            echo 
'</table>';
        }
        
$this->showWhoisForm();
        
    }
    
$this->showFooter();

}

function 
showDomainResult($domain,$server,$findText){
   if (
$this->tr == 0){
       
$this->tr 1;
       
$class " class='tr2'";
   } else {
       
$this->tr 0;
       
$class "";
   }
   if (
$this->checkDomain($domain,$server,$findText)){
      echo 
"<tr $class><td>$domain</td><td class='ava'>DISPONIBLE</td></tr>";
   }
   else echo 
"<tr $class><td>$domain</td><td class='tak'>NO DISPONIBLE</td></tr>";
}

function 
checkDomain($domain,$server,$findText){
    
$con fsockopen($server43);
    if (!
$con) return false;
        
    
// Send the requested doman name
    
fputs($con$domain."\r\n");
        
    
// Read and store the server response
    
$response ' :';
    while(!
feof($con)) {
        
$response .= fgets($con,128); 
    }
        
    
// Close the connection
    
fclose($con);
        
    
// Check the response stream whether the domain is available
    
if (strpos($response$findText)){
        return 
true;
    }
    else {
        return 
false;   
    }
}

}
?>
  #2 (permalink)  
Antiguo 19/04/2012, 03:02
Avatar de repara2  
Fecha de Ingreso: septiembre-2010
Ubicación: München
Mensajes: 2.445
Antigüedad: 13 años, 7 meses
Puntos: 331
Respuesta: Insertar Link en MaxWHois (PHP)

Qué error te sale?
__________________
Fere libenter homines, id quod volunt, credunt.
  #3 (permalink)  
Antiguo 21/04/2012, 13:30
Avatar de sarumanice  
Fecha de Ingreso: mayo-2008
Ubicación: Lima, Peru
Mensajes: 103
Antigüedad: 15 años, 11 meses
Puntos: 4
Respuesta: Insertar Link en MaxWHois (PHP)

Parse error: syntax error, unexpected '.' in midominio.com/whois/maxWhois.class.php on line 154

Y En esa linea es donde agregue el codigo para el a href :S
  #4 (permalink)  
Antiguo 23/04/2012, 00:53
Avatar de sarumanice  
Fecha de Ingreso: mayo-2008
Ubicación: Lima, Peru
Mensajes: 103
Antigüedad: 15 años, 11 meses
Puntos: 4
Respuesta: Insertar Link en MaxWHois (PHP)

Alguien podría ayudarme?

Etiquetas: dominio, max's, whois
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:42.