George Reith
George Reith

Reputation: 13476

URL lost during POST

What's wierd is that on one page I can echo a variable built by:

$protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https') === FALSE ? 'http' : 'https';
$host     = $_SERVER['HTTP_HOST'];
$script   = $_SERVER['SCRIPT_NAME'];
$params   = $_SERVER['QUERY_STRING'];
$currentUrl = $protocol . '://' . $host . $script . '?' . $params;

Then post it to another page (I know the post works because I send other values):

<?php echo'<input type="hidden" name="Refferer" value="'.$currentUrl.'"/>'?>

But when I try to use it on my other page it is now empty:

$return = $_Post[Refferer];
header("Location: $return");

Anyone know what's happening to it?

Upvotes: 0

Views: 99

Answers (3)

lbrandao
lbrandao

Reputation: 4373

Try:

<?php echo '<input type="hidden" name="Refferer" value="'.urlencode($currentUrl).'"/>' ?>

Upvotes: 1

JK.
JK.

Reputation: 5136

$_POST is case sensitive.

Try to use $_POST instead of $_Post.

Upvotes: 3

Jonathan M
Jonathan M

Reputation: 17451

Try:

$return = $_POST['Refferer'];
header("Location: $return"); 

Upvotes: 2

Related Questions