This is a discussion on How do I set Session Variables within the PHP General forums, part of the PHP Programming Forums category; I'm starting with a form that has 23 fields and I need to be able to pass and recall ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm starting with a form that has 23 fields and I need to be able to
pass and recall the information from page to page as people move through the form process. How do I set the variables to include all the form elements and how do I recall them in each subsiquent page. Previously we had been using hidden includes, but we're looking for a more elegant and consistant solution. Thanks, Chris |
|
|||
|
Dear Chris,
First of all you need to initialize the session : session_start(); You have to do this on every page during the session. I'm not sure, but it's possible that you have to put this in the script before any output... After that, the session variables are stored in the array $_SESSION[] : session_start(); $_SESSION['foo'] = "bar"; ---- next page ---- session_start(); echo $_SESSION['foo']; kind regards, Mathew christopher.j.just@gmail.com wrote: > I'm starting with a form that has 23 fields and I need to be able to > pass and recall the information from page to page as people move > through the form process. > > How do I set the variables to include all the form elements and how do > I recall them in each subsiquent page. > > Previously we had been using hidden includes, but we're looking for a > more elegant and consistant solution. > > Thanks, > Chris |