Foros del Web » Programando para Internet » PHP »

getmxrr() ,

Estas en el tema de getmxrr() , en el foro de PHP en Foros del Web. por cierto en la funcion getmxrr() , alguien sabe si existe alguna clase o libreria para poder hacerla funcionar bajo windows? gracias de antemano un ...
  #1 (permalink)  
Antiguo 11/10/2003, 21:00
 
Fecha de Ingreso: abril-2003
Mensajes: 656
Antigüedad: 21 años
Puntos: 1
getmxrr() ,

por cierto en la funcion getmxrr() , alguien sabe si existe alguna clase o libreria para poder hacerla funcionar bajo windows?

gracias de antemano

un saludo
  #2 (permalink)  
Antiguo 11/10/2003, 21:23
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 3 meses
Puntos: 129
Pues exactamente la misma función no .. pero si que hay equivalentes. Fijate en los comentarios de los usuarios de php.net sobre esa función:

http://www.php.net/getmxrr

Cita:
geoffbrisbine A T y a h o o DOT c o m
24-Sep-2002 09:39
I was pretty disappointed that the Win32 build of PHP doesn't incorporate getmxrr so, since I'm a naive newbie, I decided to hack together my own (and I stress hack). This has been tested on Win 2000 and Win XP. There's no reason this shouldn't work on Win NT but it will not work on Win 9x (you need the nslookup command). It will finish with the array $mx that will be a multidimensional array with the MX preference, host name and ip address. You can do a print_r ( $mx ) to see what it looks like.

Código PHP:
<?php
$command 
"nslookup -type=mx yahoo.com";
exec $command$result );
    
$i 0;
while ( list ( 
$key$value ) = each $result ) ) {
    if ( 
strstr $value"mail exchanger" ) ) { $nslookup[$i] = $value$i++; }
}
    
while ( list ( 
$key$value ) = each $nslookup ) ) {
    
$temp explode " "$value );
    
$mx[$key][0] = $temp[3];
    
$mx[$key][1] = $temp[7];
    
$mx[$key][2] = gethostbyname $temp[7] );
}

    
array_multisort $mx );
?>
Fijate que usa una llamada al S.O. y ejecuta el comando (en la Shell .. línea de comandos DOS):

nslookup

Ahí mismo comenta que sólo funcionaría bajo W200 o XP .. no en W9X pues no dispone de ese comando ...

Un saludo,
__________________
Por motivos personales ya no puedo estar con Uds. Fue grato haber compartido todos estos años. Igualmente los seguiré leyendo.
  #3 (permalink)  
Antiguo 11/10/2003, 21:55
 
Fecha de Ingreso: abril-2003
Mensajes: 656
Antigüedad: 21 años
Puntos: 1
gracias cluster, copiada esta, en cuanto tenga n momento la implemento en un script que utilizo la funcion getmxrr() en local y que obiamente no me va

un saludo
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 07:43.