Forum Moderators: coopster
I would like to build a form/script that can carry data over 2 or 3 pages. I've looked up on google, and it seems the best way is to use sessions.
But im unsure on how it works.
I've figured out you need to do this when submitting the form (Which is done on the same page as the form).
// create a session to put stuff into, to store over 2 pages
session_start();// Fill it with our post vars
$_SESSION['name'] = $_POST['name'];
$_SESSION['email'] = $_POST['email'];
$_SESSION['stuff'] = $_POST['stuff'];
Then when all is ok with the input, its then sent to another page. On this page is where I kinda get stuck, how do i call those values back again? And how do i use them to insert back into another form if need be?
Thanks
:)
how do i call those values back again?
And how do i use them to insert back into another form if need be?
<form action="formActionScript.php" method="POST">
<input type="text" name="myName" value="<? echo $_SESSION['name']; ?>">
<input type="text" name="myEmail" value="<? echo $_SESSION['email']; ?>">
<input type="text" name="myStuff" value="<? echo $_SESSION['stuff']; ?>">
</form>