I have set up a 4 part form using PHP Sessions. The end result displays results from 4 different pages with forms. All the data on the last page seems fine. However, I have a back option, incase people would like to go back and change an answer.
Example, on page3.php, I have a link back to page2.php.
[CODE]<a href=”page2.php”>Go Back</a>
The user can then change their answer on page2.php, but the answers that were chosen on page1.php seem to get lost.
I am defining each variable as follows
On page2.php:
[CODE]<form action=”page3.php” method=”post”><select name=”style”>
<option value=”style1″>style1</option>
<option value=”style2″>style2</option>
</select>
</form>
And page3.php has the following:
[code=php]$_SESSION[‘style’] = $_POST[‘style’];
So, say style is on page2.php,
I thought that this would keep each variable registered until it was altered or deleted with session_destroy(); or unset();
Is there something I need to specify to keep these variables?
I have session_start(); on each page.
Thank you