Posted by Ken Robinson on 04/28/06 17:33
Garry Jones wrote:
> When processing a form I am reading in a value to a mysql database. I then
> redirect the user to a "thank you" page with Header. What I would like is to
> remind the user the value he/she keyed in. Can I pass the variable in the
> Header command?
[snip]
> Header("Location: http://www.mydomain.com/thankyou.php");
> exit;
>
There are two different methods you can use:
1) Put the value into a session variable. Before the 'header()"
function, put
$_SESSION['inx01'] = $inx01;
Then in the thankyou.php script, you can get the value by referencing
$_SESSION['inx01']
Be sure you put
session_start();
at the start of each script.
2) Pass the value on the URL:
header('Location: http://www.mydomain.com/thankyou.php?inx01=' .
$inx01);
and the you can use the value in $_GET['inx01']
Ken
[Back to original message]
|