Hello,
I am trying to echo a message before redirecting the visitor to another page.
The destination is a variable. This is what i have so far:
<?php
if (array_key_exists($_GET[id],$links))
{
$red = $links[$_GET[id]];
header("HTTP/1.1 301 Moved Permanently;");
header("Refresh:3; url=$red");
echo "You will be redirected to..";
}
else {
header("Location: http://www.example.com");
}
exit(); ?>
The problem is that it works in Firefox, but not IE. In IE it will work if there is no message and no delay, like the code below:
<?php
if (array_key_exists($_GET[id],$links))
{
$red = $links[$_GET[id]];
header("HTTP/1.1 301 Moved Permanently;");
header("Location: $red");
}
else {
header("Location: http://www.example.com");
}
exit(); ?
Does anybody have any idea, what is wrong with this code?
Thank you in advance!