Advertisement
Guest User

Untitled

a guest
Dec 10th, 2011
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. include("geoip.inc"); // includes the geoip.inc
  2. $gi = geoip_open('GeoIP.dat',GEOIP_STANDARD); // loads the database
  3. $country = geoip_country_code_by_addr($gi,$_SERVER['REMOTE_ADDR']); // determines the country from current ip address and outputs 2 letter country code, for United States it's US for example
  4.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement