You can save each page of the survey to somekind of temporary table in
the database, and assign a session_id to it. So everytime the user click
"Go to Next Page", for example, the page actually submit the form,
process it using php, save it in a temporary table and use session_id to
identify it, and then the php can redirect to the next page.
The next time the user wants to go back to previous page, the page
actually query the temporary database to see if there are any survey
already in, and display them if there are, or put default values
When the user get the last screen and click, for example, "Submit my
Survey", then your page actually process all the data in the temporary
table, fuss with it anyway you want, and put them in the main table, and
delete all the entry in the temporary table that match with that
Just remember that session_id is your key to identity this session, so
you need to pass that around between pages. This will allow multiple
user accessing the same program.
This is better and saver than using cookies. Since using cookies, you're
kind of at the mercy of the user. What happens if the user does not have
the cookie turn on? what happens if the user suddently, for some unknown
reason, want to delete all the cookies in the middle of doing the
survey? I don't know for sure but they are also cookies limitation for
storing data. So my advice, always try to use server side solution for
something like this.
Hope this helps.
Reuben D. Budiardja
On Mon, 2002-07-29 at 10:59, lallous wrote:
> You can save the answers in sessions or cookies and then insert them all in
> one bunch.
> "Tyler Durdin" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I have a DB that will take answers to an 82 question survey, but i have
> > survey divided into 4 html pages(forms) of 20 or so question per page. The
> > people taking the survey are not required to fill out every question on
> > survey. i was wondering how i can insert the data into the db this way.
> > example,
> > the first html page goes to question #24 the next starts at 25 an goes to
> > 47. How can i enter 25 to 47 into the db and keep it all in numerical
> > when 1-24 are entered first? One more question, does anyone have any
> > recommendations on how i can make it so the users can take page one of the
> > survey and then come back and finish pages 2 (or something similar to this
> > where they finish one of the pages and come back to finish the others
> > later? Thanks in advance.
> > _________________________________________________________________
> > Chat with friends online, try MSN Messenger: http://messenger.msn.com
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php