Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert data to table from multiple form. 1

Status
Not open for further replies.

JJJ777

Programmer
Jun 5, 2002
33
MY
hi..
i'm using php and postgressql, i need help on how to submit data from more than one form that is in difreent pages.?

let say..there are 3 forms from diffrent pages :
form 1: user need to fill name & address
form 2 : user need to fill birthdate & phone number
form 3 : user need to fill account number & email

then the submit button is only at form number 3. my plan is when user click the submit button (at form 3 )it will also store the data from form 1 and form 2...

i'm glad if i have a detail script tq...
*there is auto increment, therefore i must use only one submit button which is in the final pages whereas the data must be store in the same profile.


 
You have several choices.

1. use session variables to collect data as the user traverses your forms, the process the data as a single insert.

2. use hidden fields in the forms of pages 2 and 3 which will store the values from earlier pages. Keep in mind that page 3's form will have to have hidden fields to store both page 1's and page 2's data.

3. Store your data incrementally. When the user submits form 1, process the input, add the data to the database and add the table index of the row you changed or added as a hidden field on page 2. When the user submits page 2, your CGI can then update the table row based upon the hidden stored index. Etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top