Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include("geoip.inc"); // includes the geoip.inc
- $gi = geoip_open('GeoIP.dat',GEOIP_STANDARD); // loads the database
- $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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement