Ver Mensaje Individual
  #4 (permalink)  
Antiguo 18/06/2007, 08:13
Avatar de Yranac
Yranac
 
Fecha de Ingreso: junio-2007
Mensajes: 125
Antigüedad: 17 años, 8 meses
Puntos: 1
Re: alguien que pueda echarme una mano con la API de OnlineNic para registrar dominio

Por ejemplo: la primera funcion habre la conexion y compureba que esta sirva, la segunda envía un comando a onlinenic. De todas formas yo estas funciones las saque de la api que ellos dan para descargar...
Código PHP:
//FUNCION QUE SE CONECTA
function connectRegServer(&$fp)
{
    if(!(
$fp fsockopen(REG_HOSTREG_PORT$errno$errstr200)))
    {
            return -
1;
    }
    
//echo REG_PORT;
    //socket_set_blocking($fp, TRUE);
    
$i 0;
    while(!
feof($fp))
    {    
        
$i ++;
        
$line fgets($fp2);
        
$result .= $line;
        if(
ereg("</epp>$"$result))
        {
            break;
        }
        if (
$i 5000) break;
    }
    
    if(
ereg("</greeting></epp>$"$result))
    {
        return 
0;
    }else {
        return -
1;
    }
}

//FUNCION QUE ENVÍA UN COMANDO
function sendCommand($fp$command)
{
    @
fputs($fp$command);
    
$i 0;
    while(!@
feof($fp))
    {
        
$i ++;
        
$line fgets($fp2);
        
$result .= $line;
        if(
ereg("</epp>$"$result))
        {
            break;
        }
        if (
$i 5000) break;
    }
    
//$myfile = fopen("abc.txt", "a");
    //fwrite($myfile, $command . "\n" . $result);
    //fclose($myfile);
    
return $result;