Cormac
New Member
Hi guys,
I have the following script which should redirect a user if they are using a Polish browser to a specific page. I have asked a Polish friend to test it using his Polish version of Firefox but he said he didn't work. Here is the code:
He says he gets brought to allotherbrowsers.com/landingpage.php instead of google.pl
Can anyone spot the problem?
I have the following script which should redirect a user if they are using a Polish browser to a specific page. I have asked a Polish friend to test it using his Polish version of Firefox but he said he didn't work. Here is the code:
PHP:
<?
function redirect()
{
$lang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
switch($lang){
case 'pl':
$redir_url = "http://www.google.pl";
break;
default:
case 'en':
$redir_url = "http://www.allotherbrowsers.com/landingpage.php";
break;
}
header("Location: $redir_url");
}
redirect();
?>
Can anyone spot the problem?