Typically we use one submit at the end of one form to place inputs into dbase. BUT:
1) Can two forms have ONE submit?
2) Can one form have two separate browser pages (sequential)?
If someone is interested in what I'm trying to do, it is to have two separate input browser pages (sequential) place their inputted form data together (in an ordered way) in ONE dbase (one MySQL db table row).
Last edited by codefreek : 01-02-2010 at 06:06 AM.
Reason: Thread was moved from, TalkPHP Developer Team to, General section.
1) Yes, make them one form, and they have one submit.
There is no protocol for POST1, POST2, etc. So everything you send, either via GET or POST is technically being sent as a single string of data. If you wanted to, you could nest an array inside of $_POST. Use names for your inputs such as;
2) Yes, but again it's not technically the same form. You can post data from one form to the next and than pass it on the second time either via hidden inputs, session variables, ajax, etc.
There's a lot of possibilities for ways to handle this. Handle the forms as they come and just insert data fragments until you've got a complete row; place the data from the first table into a meta table that the second form will use to complete the row in the actual table; as mentioned above, pass the data along through hidden inputs and re-validate it on the other side of the second form; store it in session variables that the second forms handler will use to complete the query; etc.