I have page1.php
with this code:
<form action="/redirect.php" method="POST" target="_blank">
<input name="destination" type="hidden" value="a"/>
<input type="submit" value="Click here"></form>
and this is redirect.php
:
<?php
$url = "http://www.default.com";
if(isset($_POST['destination'])){
switch ($_POST['destination']) {
case "a":
$url = "http://www.domain1.com";
break;
case "b":
$url = "http://www.domain2.com";
break;
default:
$url = "http://www.default.com";
}
}
header( "refresh:1;url=$url" );
?>
<!doctype html>
<html>
<head>
</head>
<body>
<div>Redirecting, Please wait</div>
</body>
</html>
I've created the redirect page this way because it's important for me that it would load and display certain content, rather than redirect straight away (and thus, it yields out a 200 code, rather than a 302 code).
However, only on Chrome and Safari, the Headers of the redirect contain information about the referring url, which is redirect.php
, and thus, for example, the owner of domain1.com
will know that the visitor came from mydomain.com/redirect.php
.
But on IE and FF, the referrer in the headers is null. What is causing this different behavior and how can I fix it to have them carry the same referrer info as well?