The POST values are empty because the third page isn't receiving a POST request. The order of events is this:
- User requests the first page.
- User POSTs a form to the second page, with values.
- Second page tells the user to issue a GET request to the third page.
- User requests the third page.
There are a few different ways to keep the information in the chain. You can:
- Add it to the query string for the redirect
- Store it in session
- Store it in a database
- etc.
The first one might look like this:
header("Location: " . $url . "?key=value");
Where the key/value pair is similar to those in a POST. In this case the values would be available to the third page in GET:
$_GET['key']
If you use session, the values stay server-side. So in the second page you can set the value:
$_SESSION['key'] = $value;
And then retrieve it in the third page:
$value = $_SESSION['key'];
Note that these session values will continue to live on the server until the session times out. You may want to unset them from the session once you're done with them if it starts to add confusion to other pages the user visits which also make use of these values.