I was testing that case with this:
<?php
if (isset($_GET['foo']) ) {
echo '<pre>';
print_r($_GET);
echo '</pre>';
exit();
}
$fp='http://server/header.php?foo=bar&var=abc';
header("Location: ".$fp);
exit();
?>
I call the address: http://server/header.php
and the redirect works fine to 'http://server/header.php?foo=bar&var=abc' and the _GET is complete:
Array
(
[foo] => bar
[var] => abc
)
Notice:
- location with first letter as capital letter.
- the colon and space after "Location"
- the full link
- the exit() call.
On the other hand, make sure that nothing is outputed to the browser BEFORE THE REDIRECT EXECUTES.