Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/01/2011, 21:44
JaimeSavines
 
Fecha de Ingreso: octubre-2009
Mensajes: 245
Antigüedad: 14 años, 6 meses
Puntos: 17
Respuesta: direcciones IPS

Igual te sirve este fragmento

Código PHP:
Ver original
  1. <?php
  2. if (getenv("HTTP_X_FORWARDED_FOR")){
  3. $ip = getenv("HTTP_X_FORWARDED_FOR");
  4. $client = gethostbyaddr($_SERVER['HTTP_X_FORWARDED_FOR']);
  5.   } else {
  6. $ip = getenv("REMOTE_ADDR");
  7. $client = gethostbyaddr($_SERVER['REMOTE_ADDR']);
  8.    }
  9. $str = preg_split("/\./", $client);
  10. $i = count($str);
  11. $x = $i - 1;
  12. $n = $i - 2;
  13. $isp = $str[$n] . "." . $str[$x];
  14. echo '<div>Tu IP es:<b style="color:880000"> '.$ip.'</b> <br><br />
  15. Tu ISP es: <b style="color:000088">'.$isp.' </b></div>';
  16. ?>