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 diff
You can use: string geoip_country_code_by_name ( string $hostname )
Example:
Output:
This host is located in: US
For your case you can use: geoip_country_code_by_name($_SERVER['REMOTE_ADDR']); to get the country code for the current user.
geoip_country_code_by_name($_SERVER['REMOTE_ADDR']);