...

View Full Version : Need a hand in this multiple page contact form thing



eiger23
01-16-2012, 06:44 AM
Alright, so I've been working on this site for my company and I am completely stuck on trying to create a form that is spread out on 2 pages. The first part of the form which is on the home page (http://lubellrosen.com/work/index.php) has 3 questions which are drop down menus. After the user hits submit, I want it to take them to a general contact form (http://lubellrosen.com/work/Contact-Us.asp). Once they submit that I want all the data to be mailed out to a specific email address. I've been looking everywhere and it's just been driving me crazy trying to figure this out.:confused:

fatecaresx13
01-16-2012, 07:14 AM
Couple ideas for you. So I'm assuming this is a simple PHP POST method form (or GET doesnt really matter) and you want to know how to pass the data from page to page. You can take one of few approaches:

1. Have the first form pass data to the second form and populate HIDDEN fields. So for example:


<form>
<input type="hidden" name="from_first_form" value="from_first_form_val" />
</form>

The other method, which i'd personally do:

2. Store the form submission data to a database or file and read it back in at the end of the process all at once. You'd only need to pass SESSION information to make sure it's the same person going through the form.

And now that I mention it:

3. You can use SESSION value to store data as they navigate the site. Set the $_SESSION values to the submitted values and then at the end of the form process mail all those values.


Thanks,
Anthony

eiger23
01-16-2012, 03:28 PM
ok but if I take option one, wouldn't I have to do a start session either way?

BluePanther
01-16-2012, 04:49 PM
ok but if I take option one, wouldn't I have to do a start session either way?

No. You could populate the hidden fields using POST. Could be easier, considering you're submitting the first form to get to the second one.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum