PHP IF Statment Based On Geo Location?
Is there a way to do a PHP If statement based on the persons location? My problem comes down to Amazon Affiliate links. The link to buy a DVD on Amazon.co.uk is different to the one to buy from Amazon.com and I want a way to only show the correct one. At the same time, If they aren't based in either country, then I don't want the link to show in the first place. Example: If Location = UK; print "amazon-UK-link" If Location = US; print "amazon-US-link" If location = None of the above; print nothing You can use: string geoip_country_code_by_name ( string $hostname ) Example: <?php $country =