PHP - capturar ip en php

 
Vista:

capturar ip en php

Publicado por alberto (4 intervenciones) el 16/03/2012 20:50:29
hola q tal e intentado recoger el ip de mi host con el siguinete codigo per solo me devuelve 127.0.0.1
para ejecutar mi script utilizo la url http://localhost/banda.php cual seria el problem


<?
$ip = $_SERVER['SERVER_ADDR'];
//$ip=$_SERVER[HTTP_CLIENT_IP];
//$ip=getenv("SERVER_ADDR");
echo($ip);
?>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder