Ver Mensaje Individual
  #9 (permalink)  
Antiguo 14/11/2002, 15:09
Avatar de Cain
Cain
 
Fecha de Ingreso: enero-2002
Ubicación: Catalunya
Mensajes: 6.459
Antigüedad: 22 años, 3 meses
Puntos: 17
Código PHP:
global $REMOTE_HOST$REMOTE_ADDR$HTTP_X_FORWARDED_FOR$MIRRORS;
    
    
// We do not know the country
    
$country '';

    
// Figure out IP address and hostname
    
$ipaddr $HTTP_X_FORWARDED_FOR $HTTP_X_FORWARDED_FOR $REMOTE_ADDR;
    
$hostname $REMOTE_HOST;
    
    
// If we have no hostname, or if it's an IP
    // address, then try to get that hostname
    
if  (!$hostname || $hostname == $ipaddr) {
        
$hostname = @gethostbyaddr($ipaddr);
        if (
$hostname == $ipaddr) { $hostname ""; }
    }
    
    
// If we have that hostname finnaly, get the TLD
    
if ($hostname) {
        if (
ereg('([a-zA-Z]+)$'$hostname$reg)) {
            
$country $reg[0];
        }
    } 
Estaba más escondido de lo que recordaba
__________________
M a l d i t o F r i k i