PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 21st, 1999, 03:54 PM
kumars
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I have a an user registration database. Instead of having all the 60 fields in one form, I wanted to do it in 3 forms.

Form1 - for user information
Form2 - for company information
Form3 - for userid password.

The logic of the form should be that the user cannot fill Form3 without completing Form2 and Form1 etc after data validation(no space in last-name, zipcode, phone, email).When the user in Form3, and wish to change Form1 field it should be possible.

Can some one give me what technicque (cookie or Global variables etcO) is appropriate for this..

Advance thanks


Reply With Quote
  #2  
Old August 22nd, 1999, 07:18 AM
rod k
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
3 makes it a bit tricky since you want to be able to allow editing. The best solution I can see is to create a table for temporary storage. When you process the first form and after validation store those entries in the table. Same for 2. Then with the third after validation you can pull all the info from the previous 2 forms and put it all in your perm table. The temp table should contain a unique id that can be passed to each form. If the id is set your script can pull the previously stored info from the temp table and include it in the form as HTML input "value"s.

HTH

Rod

Reply With Quote
  #3  
Old August 25th, 1999, 10:51 AM
moderator
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
You could also pass all the variables as hidden fields in the HTML code, then actually make the mysql query after the 3rd form. So if they don't complete all 3 forms nothing gets stored in any table. However, depending on the forms that can get tricky and pretty ugly.

Reply With Quote
  #4  
Old August 25th, 1999, 02:26 PM
rod k
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
This is true, but again, it would be very, very ugly since he wants to allow editing of the previous changes, so you'd have to pass all those variables back to the beginning. Really, bad would be if the user is at the third page and wants to change the first. You'd have to carry all the variables for page 2 and 3 to 1 then back. YUCK.

Since he said he had a DB available I'd use that and let each form only worry about itself. Check a session id, check the table to see if it has info already stored and generate the form using the data from the table to auto-populate the form. Bingo! No muss, no fuss.

If I didn't have a DB available I probably wouldn't even tackle this. If I HAD to do it, I'd at least use a flat file.

Rod

Reply With Quote
  #5  
Old August 30th, 1999, 01:21 PM
Paul Cotton
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
You would use PHP to get all variables from the preceeding page using :
while ( list( $key, $val )=each($HTTP_POST_VARS) )

and auto create the hidden fields in the forms, minimising the work.

This would work in reverse as you could look at the fields and repopulate the html form elements.

No database, very quick and relatively easy.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > How to combine multiple forms using PHP3

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap