- 1,251 categories
- 40,829 scripts
Updated: 04/02/2008
- This script basically detects the visitors IP Address and returns the country accordingly. Fairly simple to use. There is just one function currently but I''ve got plans to expand it further.
When the function get_user_country is called it will detect the ip address of the visitor and return the country name, the 2 letter country code and the 3 letter country code for the ip address.
Use it to detect the country of your visitors. You can use it to collect stats or display unique content based on the users country.
Basically, all you need is a web server with PHP && MySQL installed and the IP-to-Country database distributed by WebHosting.info. The latest version of the database can be downloaded at http://ip-to-country.webh osting.info/downloads/ip- to-country.csv.zip
This script was tested on RedHat(tm) Linux and Windows(tm) both with Apache as the webserver. The PHP version in use was PHP 5.1.6 and the MySQL version in use was MySQL 5.0.27
- Categories
- Platforms
- Licenses
- Other Free / Open Source License
- Author