Newer
Older
Digital_Repository / Repositories / Misc / geoip_test.php
nstanger on 17 Jan 2007 296 bytes - Added a small test script for GeoIP.
  1. <?php
  2. include("geoip.inc");
  3.  
  4. // change the first argument to the correct location of the GeoIP.dat file.
  5. $gi = geoip_open("/sw/share/GeoIP/GeoIP.dat",GEOIP_STANDARD);
  6.  
  7. print geoip_country_code_by_addr($gi, "139.80.64.99") . "\n";
  8. print geoip_country_name_by_addr($gi, "139.80.64.99") . "\n";
  9.  
  10. ?>