Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Handling using Sessions

Status
Not open for further replies.

Dynamo3209

Programmer
Jan 2, 2003
57
US
Hi,
I am new to php. Developing a Survey site using php sessions.I have three php pages for surve, a user is taken to the next page depending upon what his answers are to the previous page questions. Can in any way I can retrieve the choices entered my the user on the first page at the en page as I want to save the entire data in a database after the user fully completes the survey.
Plz help.
I am doing it like this
Code:
foreach($HTTP_POST_VARS as  $key=>$value)   
{
        $SURVEY[$key]  = $value ;
        echo (&quot;$key  = > $value<BR>\n&quot;);
        }
but not able to retrieve the session data entered on the first page of the survey at the end page of the survey to enter it into the database, once the survey is fully completed by the user.
Thanks
 
Assume that you submitted a form containing:
<input type=&quot;text&quot; name=&quot;me&quot; value=&quot;him&quot;>
You could then put this on page 2:
<? SESSION_REGISTER(&quot;me&quot;); ?>
To retreive it on the last page:
<?= $me ?>
Make sure you had:
<? SESSION_START(); ?>
before you try to get the value back.

Rick
-----------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top