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.
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.
not necessarily. You can download the ip2location database for free, if you're technically capable of programming your own code for using that data
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"; }..................... PHP: