Submit 2 Pages of Info to 1 MySQL Table
I've seen long registration forms broken up into two pages. How can I have one page submit info to a table, and then another page submit more info in the same table?
Any help is appreciated.
Thanks in advance.
you can pass the values from the first page to the second page, and then pass all the values at once to MySQL; no need to write twice.
Yea but the pages won't be right after each other. I have one page were people can go to at a later date. Sorry I should have specified that.
Well, can you not write to the db from both pages then?
Is the second page gong to replace/update things from the first page?
The more details you can share now, the easier it is for us to help.
The second page doesn't replace anything in the db. It only replaces the nulls that automatically fill in after the first page gets submitted. I just dont know how to insert the second page of data to the same user's row. If thats unclear let me know.
Then again, actually see what you have for a form code would make it a whole lot easier to understand.
$sqlUpdate = "UPDATE `table` SET `column1` = ' " . $_POST['name'] ." ', `column2` = ' " . $_POST['instruction'] . " ' WHERE `rowID` = ' " . $_POST['rowID'] ." ' ";
Last edited by OctoberWind; 02-18-2009 at 09:34 AM.
Reason: quotaions: yea, you dont have to open/close so many singles/doubles, but still... it works...
Or you could create one big form, which you split into several hidden divs, which you then use dhtml to hide or show.
While the initial page will take a little longer to load, overall, the solution will be much faster (and therefore nicer to use) because it's not using bandwidth to pass, and then re-pass variable values from one form to the next. When the user clicks on [Next], the next page of the form will appear instantly, and your user can switch seamlessly between pages of your form without you having to worry about any coding at all.
Update function is perfect! one question. You mentioned earlier that i could pass the values. I can pass the values just fine but once the second page is filled out how do i submit all the values? Would this be right:
first page with first form:
second.php(second page with second form):
<form action="second.php" method="post">
<input name="first" type="text" />
<input type="submit" />
$first = $_POST['first'];
<form action="process.php" method="post">
<input name="second" type="text" />
<input type="submit" />
Im kind of new to php so.
$second = $_POST['second'];
chestertb, i was originally going to do that but, like you said, i need to use value of the first page in order to continue with the next.
Nevermind, I got it! Thanks for all your help
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread