Jump to content
xisto Community
Sign in to follow this  
apple

Putting Data Of 2 Pages In Mysql At Once

Recommended Posts

suppose i have a page, page.php?part=1 there i have some text fields. user will give input, but after taking input, it will not put the data in mysql .. but it will take to the next step.. page.php?part=2 (if any field is left blank, it will not go to next page.. ) . and there also some fields.. after the user has filled that form also, then it will insert all data (from part1 and part 2) in mysql. i want to ask, how i can collect data from 2 pages and put in mysql at once.

Share this post


Link to post
Share on other sites

Well if you take the vars from page one lets call them $var_pg1_one and $var_pg1_two and store them in page 2 via the POST/GET vars one page two:

$var_pg1_one = $_POST['pg1_one'];$var_pg2_two = $_POST['pg1_two'];

then have the form for that page and have hidden fields which contain the vaues of the above variables like:

<input type=hidden name=var_one value=$var_pg1_one>

then on the third page which is the processing page or both forms you just recall all the variables from both pages using the GET/POST method and then store them in the DB

Does that make sense?

alternatively you can use a select case to change the HTML code of the page and still store the variables as the php page isnt actually a different page.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.