Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/06/2010, 12:56
all-ill
 
Fecha de Ingreso: junio-2002
Mensajes: 750
Antigüedad: 21 años, 10 meses
Puntos: 22
Respuesta: Saber quien esta conectado a mi web

Entre otras cosas puedes saber la dirección IP:
http://www.php.net/manual/es/reserve...les.server.php

Fuente de la siguiente función: http://roshanbh.com.np/2007/12/getti...ss-in-php.html
Código PHP:
function getRealIpAddr()
{
    if (!empty(
$_SERVER['HTTP_CLIENT_IP']))   //check ip from share internet
    
{
      
$ip=$_SERVER['HTTP_CLIENT_IP'];
    }
    elseif (!empty(
$_SERVER['HTTP_X_FORWARDED_FOR']))   //to check ip is pass from proxy
    
{
      
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    else
    {
      
$ip=$_SERVER['REMOTE_ADDR'];
    }
    return 
$ip;