View Full Version : Serving different content to users from different geographic regions
fcmisc
Mar 19th 2006, 6:09 am
Hi,
The Amazon Associate feature of only serving up ads to a particular country is hindering my sales.
Using PHP, how can I detect a user's country, and therefore serve them different Amazon ads?
Thanks,
fcmisc.
frankcow
Mar 20th 2006, 8:38 am
I believe you need to use ip2location, or geoip
sketch
Mar 20th 2006, 9:17 am
Both of which will cost you money... there's is no function in any programming language (that I know of) that can tell you where an IP is geographically located.
frankcow
Mar 20th 2006, 9:22 am
not necessarily. You can download the ip2location database for free, if you're technically capable of programming your own code for using that data
mad4
Mar 20th 2006, 9:24 am
There are several services to find the location of an IP address.
http://www.maxmind.com/app/geoip_country
http://software77.net/cgi-bin/ip-country/geo-ip.pl
http://ip-to-country.webhosting.info/
http://www.ip2location.com/free.asp
Once you know the location just do
if($location=="US"){
echo"US content";
}
elseif($location=="UK"){
echo"UK content";
}.....................
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.