Tag Archives: maxmind

Use Maxmind Free GeoLiteCountry for geo targeting visitors (example)

So, I should put it here for my personal notes, in case I lost my notes.
Maxmind provide us, developer, a free geo IP country database. This database is useful for geo targeting visitors. For example you can show special message for visitors coming from certain country or maybe blocking visitors that coming from certain country. Ads targeting is also one of it’s usage.
Here’s step by step guide for Maxmind GeoLiteCountry :

Sample PHP code usage:

Notes: this free database is updated monthly. Usually every first week of each month, so make sure you download the latest GeoIP.dat.gz file.

updated: Maxmind’s geoip.inc has been moved to github (didn’t realize it before)