stijn0713 Posted August 11, 2012 Share Posted August 11, 2012 Hello, i'm trying to make a little survey program. So far, in my view_survey.php page i retrieve all the questions and options from the database and put them in a session. For each new question, i echo a form with question and the options and, after submit i unset that question in the session. I don't think this is a good way, as i cannot go back to the previous question for example. Any suggestions of tackling it another way? Quote Link to comment https://forums.phpfreaks.com/topic/266938-form-data-not-able-to-go-to-previous-page/ Share on other sites More sharing options...
Christian F. Posted August 11, 2012 Share Posted August 11, 2012 Store the question ID / step number in the session, and use that to fetch the correct question from the database when you need it. I've answered a very similar question to this one a few weeks back, and outlined how I'd do the process in my reply in that thread. I recommend a search for it, as you should find that thread quite useful. Quote Link to comment https://forums.phpfreaks.com/topic/266938-form-data-not-able-to-go-to-previous-page/#findComment-1368563 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.