Forums
This topic is locked
Passing variables not working,
Posted 19 Jan 2003 20:44:09
1
has voted
19 Jan 2003 20:44:09 carlos reyes posted:
I have a registration page called registration.php, the Form contains inputs fields and enters the information into a database. The form action has a value:action= ?php echo $editFormAction; ? method="POST"
with the proper php format, but can't use it here or it wont display.
When i created the server behaviour to input the data into the data base I redirect to thanks.php when its done. I try to echo the variables from register.php in thanks.php and get " "
Since the form it's not explicitly sending to thanks.php this makes sence, but how can I easily fix this?
Life is simple, as long as you dont complicate it.
Edited by - zzzreyes on 19 Jan 2003 20:45:28
Edited by - zzzreyes on 19 Jan 2003 20:46:08
Replies
Replied 20 Jan 2003 16:57:41
20 Jan 2003 16:57:41 Brent Colflesh replied:
Dear ZZZreyes,
Add the posted variables to the end of the redirect link and GET them on the thanks.cgi page.
Or, better yet - get the insertion ID of your POST to the db, then query for that ID on your thanks.cgi page.
Regards,
Brent
Add the posted variables to the end of the redirect link and GET them on the thanks.cgi page.
Or, better yet - get the insertion ID of your POST to the db, then query for that ID on your thanks.cgi page.
Regards,
Brent
Replied 09 Feb 2003 08:47:54
09 Feb 2003 08:47:54 Nicholas Bennett replied:
another optin could be to use session vars i.e if you have an input in your form called name and one for email ... on the script that processes the form set a session.
$_SESSION['name'] = $_POST['name'];
$_SESSION['email'] = $_POST['email'];
then on your thanks.php page you can echo the data like:
echo "Thank you " . $_SESSION['name'] . " an email has been sent to " . $_SESSION['email'] . ".";
$_SESSION['name'] = $_POST['name'];
$_SESSION['email'] = $_POST['email'];
then on your thanks.php page you can echo the data like:
echo "Thank you " . $_SESSION['name'] . " an email has been sent to " . $_SESSION['email'] . ".";