Jump to content

Recommended Posts

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?

 

 

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.