Advertisement
verrary

GeoIP for PHP

Jan 21st, 2015
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. <?php
  2. /* GeoIP functionality for PHP project */
  3.  
  4. $ip=$_SERVER["REMOTE_ADDR"];
  5. include("geoip.inc");
  6. $gi0 = geoip_open("GeoIP.dat",GEOIP_STANDARD);
  7. $country_code = geoip_country_code_by_addr($gi0, $ip );
  8. echo $country_code;
  9. geoip_close($gi0);
  10. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement