Ver Mensaje Individual
  #10 (permalink)  
Antiguo 03/05/2014, 06:35
Avatar de Italico76
Italico76
 
Fecha de Ingreso: abril-2007
Mensajes: 3.303
Antigüedad: 17 años
Puntos: 292
Respuesta: Saber la provincia que visita mi página web.

Muy buena esa base datos! en fin..... habia buscado la documentacion para colaborarle al compañero y la deje donde no era.... pense algun moderador se daria cuenta y la moveria :P

Código PHP:
Ver original
  1. #!/usr/bin/php -q
  2. <?php
  3.  
  4. // This code demonstrates how to lookup the country, region, city,
  5. // postal code, latitude, and longitude by IP Address.
  6. // It is designed to work with GeoIP/GeoLite City
  7.  
  8. // Note that you must download the New Format of GeoIP City (GEO-133).
  9. // The old format (GEO-132) will not work.
  10.  
  11. include("geoipcity.inc");
  12. include("geoipregionvars.php");
  13.  
  14. // uncomment for Shared Memory support
  15. // geoip_load_shared_mem("/usr/local/share/GeoIP/GeoIPCity.dat");
  16. // $gi = geoip_open("/usr/local/share/GeoIP/GeoIPCity.dat",GEOIP_SHARED_MEMORY);
  17.  
  18. $gi = geoip_open("/usr/local/share/GeoIP/GeoLiteCityv6.dat",GEOIP_STANDARD);
  19.  
  20. $record = geoip_record_by_addr_v6($gi,"::24.24.24.24");
  21. print $record->country_code . " " . $record->country_code3 . " " . $record->country_name . "\n";
  22. print $record->region . " " . $GEOIP_REGION_NAME[$record->country_code][$record->region] . "\n";
  23. print $record->city . "\n";
  24. print $record->postal_code . "\n";
  25. print $record->latitude . "\n";
  26. print $record->longitude . "\n";
  27. print $record->metro_code . "\n";
  28. print $record->area_code . "\n";
  29. print $record->continent_code . "\n";
  30.  
  31. geoip_close($gi);
  32.  
  33. ?>

Sacado de MaxMind usando Google:

http://www.maxmind.com/download/geoi...le_city-v6.php
http://dev.maxmind.com/geoip/legacy/install/country/

Posteado hace 1 dia en el hilo equivocado
__________________
Salu2!