Forum Moderators: coopster

Message Too Old, No Replies

Storing multiple page's form values

         

babloo

6:01 am on Nov 9, 2004 (gmt 0)

10+ Year Member



Hello,

I have got 4 to 5 html forms with so many fields like textbox,radiobutton,checkbox,textarea etc. Can you please guide me which is the best method to store
the form values. (I don't want to use sessions.) When I go to 2nd page, the values of first page should store some where and later I should retrieve all the values and insert to the database.
Is there any other best method. How about arrays. Please help.

Babloo

Salsa

8:24 am on Nov 9, 2004 (gmt 0)

10+ Year Member



Without sessions, the two options I can think of are to pass the variables from page to page in hidden form fields as you go. Or you could populate the database after each page submission and only pass on an id in a hidden form field.

If you're using MySQL and have an auto_increment id field in your target table, call mysql_insert_id() after your first INSERT, and that will return the unique record id number that was put in the auto_increment id field. From then on, that's what you'd pass from page to page in a hidden field. After each page submission, UPDATE the record with the additional information.