I have a multi-step form that I have spread across 4 separate pages - in other words, 4 sections (I chose this method as it would be far too complex to process all my fields on one page). In my MySQL DB I have a table for each of the sections on each page (step1
, step2
, step3
, step4
). After submitting the first page I would like to insert my Page1 data to the DB and have it return the Primary Key, which I aim to then post to the next page (step2.php
) ... and the same process will follow for Step3 and Step4.
The tables for Step2, Step3 and Step4 in the DB all have a Primary Key (reg_id
) which are also all Foreign Keys to step1.reg_id
.
I would like some advice/suggestions please on how to:
- Post data back to my DB after each page submit (Do I post back to the same page, or have a separate processor page to handle that?)
- Redirect to the next page
- Pass the
reg_id
returned from Step1 to the Next Step pages
I am using plain and simple PDO to get my data in MySQL. I admit that I don't have a lot of PHP knowledge to accomplish this as I am too used to the lifecycle of ASP.NET webforms development, hence my asking for your expertise here.
Much appreciated as always!