Hello, I try for the last hours to get a onClick geo-ip redirect that I can use for my wordpress site. Basically when a US person click the "Download" he should go to English LP, when a FR clicks, to FR LP and so on. All scripts that I find redirect on page load, I want on click.
Here is what I found but can't make it work.
PHP Code:
<?php
$country_code = $_SERVER["HTTP_CF_IPCOUNTRY"];
if ($country_code=="UK") {
$link = 'Insert UK Link';
}
elseif ($country_code=="FR") {
$link = 'Insert France Link';
}
elseif ($country_code=="DE") {
$link = 'Insert Germany Link';
}
else {
$link = 'Insert Default Link';
}
header("location:$link");
exit;
?>
Basically I want the <a href = "http://mylanding.com" /a> to change according to country.