Hiya,
Okey - im currently in the process of developing an insurance quotation system, I have a form which needs to be completed which is 40/50 questions long. I want to break this down into pages.
Ive create each section of the form as an include file
inc_page1
inc_page2
inc_page3 etc
I have then create an index page which includes them based on id number from URL (index.php?id=1) This will lead to a final page id=6 which will perform the calculation, initiate an email and insert data into the backend SQL database.
I have everything else working - but im struggling with a tidy solution to moving the form submission data from one form to the next?
page 1 -> page 2 -> page 3 -> page 4 -> page 5 -> finally page 6
Im currently posting form fields from one to the next, and hidding these fields on the next page.
Could anyone suggest a cleaner solution?
Thanks
Rob.
Multiple page submission form
Moderator: General Moderators
Multiple page submission form
Last edited by Appleton on Fri Jul 06, 2007 5:04 am, edited 1 time in total.
I guess, Gente would have written "What about cookies?" then.Appleton wrote:From sessions i assume you mean Cookies?
see http://de2.php.net/session
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
I've currently been working on a registration system made up of multiple pages.
Firstyl I setup up 4 session variables ($_SESSION["stage1"], $_SESSION["stage2"]...) as my registration is only 4 pages long.
I set the intial values to all these session variables to zero.
I use forms to submit data from each page. I direct the form action"..." to the same page and then validate the user input (email etc...).
If validation is ok then I set the session value of that page to 1 ($_SESSION["stage1"]=1;).
To get to the next page of registration I then use a conditional statement e.g.:
I do the same thing for the subsequent pages. This works perfectly for me.
As for the data, I just store that in encoded session vars.
Firstyl I setup up 4 session variables ($_SESSION["stage1"], $_SESSION["stage2"]...) as my registration is only 4 pages long.
I set the intial values to all these session variables to zero.
I use forms to submit data from each page. I direct the form action"..." to the same page and then validate the user input (email etc...).
If validation is ok then I set the session value of that page to 1 ($_SESSION["stage1"]=1;).
To get to the next page of registration I then use a conditional statement e.g.:
Code: Select all
if($_SESSION["stage1"]==1 && $_SESSION["stage2"]==0)
{
include"stage2.php";
}As for the data, I just store that in encoded session vars.