English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm writing a module which requires a code to identify which country this visitor is visiting from. But I can't find the PHP code. Any help will be much appreciated. ;)

2007-03-07 06:13:47 · 3 answers · asked by Azyure Hikari 2 in Computers & Internet Programming & Design

3 answers

http://www.maxmind.com/app/geoip_country

You need to maintain a database of IP addresses and their respective countries. Services like the link above provide that database. There is a free version with decent accuracy and a paid-for version that is much more reliable.

2007-03-07 06:18:38 · answer #1 · answered by Rex M 6 · 0 0

Maintain database of IP address and location.
And in $_SERVER['REMOTE_ADDR'], you can get the client's IP address. Match this ip address in the range in your database and you can guess the location of client.

2007-03-08 04:42:43 · answer #2 · answered by Atif Majid 3 · 0 0

http://www.phpfreaks.com/quickcode.php

this website has all kinds of PHP codes

2007-03-07 14:20:30 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers