Page 1 of 1

Form and session variables

Posted: Tue Dec 23, 2003 9:32 am
by amarquis
Hi all !

I have a multiple pages form and I POST my values form page to page using method="POST" and on the next page I register all my fields as session variables using $_SESSION['FIELD1'] = $FIELD1;

It seems that once a value is passed as a session variable I cannot change it anymore ? What I would like to is that users could resbmit a page of the form, having changed some fields and that these values would now be taken and not the first ones.

How could I do that ?

Thanks for your support to a PHP rookie !! :roll:

Posted: Tue Dec 23, 2003 11:26 am
by Bill H
Session variables can be changed at will. Having done:

Code: Select all

<?php
$_SESSION['FIELD1'] = $FIELD1; 
?>
You can at any time or in any subsequent script just:

Code: Select all

<?php
$_SESSION['FIELD1'] = $FIELD5; 
?>

Posted: Tue Dec 23, 2003 12:46 pm
by amarquis
Mmh... I solved my problem ! :wink:

But no this didn't work for me since I use POST method I had to use

Code: Select all

<?php
$_SESSION['FIELD1'] = $_POST['FIELD1'];
?>
Otherwise my values were not updated...

But thanks anyway !