TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-27-2009, 12:43 AM   #1 (permalink)
The Visitor
Newcomer 
 
Join Date: Nov 2009
Posts: 2
Thanks: 0
wmpl is on a distinguished road
Default Form adds

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).
THX

Last edited by codefreek : 01-02-2010 at 06:06 AM. Reason: Thread was moved from, TalkPHP Developer Team to, General section.
wmpl is offline  
Reply With Quote
Old 11-27-2009, 03:19 AM   #2 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

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;

html Code:
<input type="text" name="form_one[option_one]" value="" />
<input type="text" name="form_two[option_one]" value="" />

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.
delayedinsanity is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Validation Not Working :( Guezala Absolute Beginners 27 05-13-2009 08:28 PM
Form to submit to another form patmagpantay General 8 07-21-2008 07:42 AM
email fill in form help? PHP sacred_tinker Absolute Beginners 19 05-28-2008 05:58 AM
Contact Us Form Mohamad Script Giveaway 4 10-03-2007 02:22 PM
Form Processing William Tips & Tricks 8 04-17-2005 03:24 PM


All times are GMT. The time now is 12:24 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design