Ver Mensaje Individual
  #3  
Antiguo 29-03-2007
Avatar de jhonny
jhonny jhonny is offline
Jhonny Suárez
 
Registrado: may 2003
Ubicación: Colombia
Posts: 7.058
Reputación: 30
jhonny Va camino a la famajhonny Va camino a la fama
Bueno, y si definitivamente decides que lo mejor para ti es la función en php pues te dejo un codigo que vi en la siguiente pagina:

http://www.cristalab.com/tips/31759/...ra-web-con-php

Código PHP:
//Obtener IP:$_SERVER["HTTP_CLIENT_IP"]!=""?$ip=$_SERVER["HTTP_CLIENT_IP"]:$ip=$_SERVER["REMOTE_ADDR"];
//Función de obtención de IP (basado en la web de webhosting.info)   
function getCountry($ip_address){      //By Marc Palau (http://www.nbsp.es)      
     
$url "http://ip-to-country.webhosting.info/node/view/36";            
     
$inici "src=/flag/?type=2&cc2=";            
     
$ch curl_init();      
     
curl_setopt($chCURLOPT_URL$url);      
     
curl_setopt($chCURLOPT_POST,"POST");      
     
curl_setopt($chCURLOPT_POST1);      
     
curl_setopt($chCURLOPT_POSTFIELDS"ip_address=$ip_address");             
     
ob_start();            
     
curl_exec($ch);      
     
curl_close($ch);      
     
$cache ob_get_contents();      
     
ob_end_clean();            
     
$resto strstr($cache,$inici);      
     
$pais substr($resto,strlen($inici),2);            
     return 
$pais;   
}
//obtención de código de país:$pais = strtolower(getCountry($ip)); 
__________________
Lecciones de mi Madre. Tema: modificación del comportamiento, "Pará de actuar como tu padre!"

http://www.purodelphi.com/
http://www.nosolodelphi.com/

Última edición por jhonny fecha: 29-03-2007 a las 22:23:18.
Responder Con Cita