PHP Tutorial : Detect visitor country by ip address

Well, well, well,
It seems a “global” interests in this php script to detect visitors country, so, I decided to write a guide on how you could get it done.
There is a free solution to detect visitors country by ip address, called maxmind geoip which you can see and get here http://www.maxmind.com/app/geolitecountry
Whats needed? Download the CSV file, then import it via PhpMyAdmin application or simple mysql console into a new database.
After that, you can use it to do simple queries to detect a country via an ip address. You can see examples on maxmind’s website too.

This entry was posted in Usefull PHP and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>