Re: Pass value to header?
- From: "Ken Robinson" <kenrbnsn@xxxxxxxxx>
- Date: 28 Apr 2006 07:33:13 -0700
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
.
- References:
- Pass value to header?
- From: Garry Jones
- Pass value to header?
- Prev by Date: Pass value to header?
- Next by Date: Re: Looking for general advice on security
- Previous by thread: Pass value to header?
- Index(es):
Relevant Pages
|