PDA

View Full Version : Sending data to another form



eiger23
Dec 20th, 2011, 07:44 PM
On the front page of my companies website I want to put a few questions and then a 'Sign Up Now' button underneath that will take them to the rest of the form they have to fill out. Then when they hit submit on that form it will submit both the first and second form to an email. How would I go about this. I already have the two forms made, but how do I link both of them in the second form so that they both go out together in one email.

teedoff
Dec 20th, 2011, 07:45 PM
Static html will not do this. HTML cannot pass form input values to another page. You would need a server side manguage to do this.

eiger23
Dec 20th, 2011, 08:04 PM
ok, will I be able to do it with ASP or just PHP, and how would I go about doing it?

teedoff
Dec 20th, 2011, 08:15 PM
Here (http://www.tizag.com/phpT/examples/formex.php)is a good tutorial in php.

Rowsdower!
Dec 20th, 2011, 10:20 PM
PHP can do this either strictly with successive forms (wherein one form's submission populates hidden input elements in the next form via PHP script) or with sessions (wherein one form submission populates a server-side PHP array of data that persists across pages for later use when the final form is submitted - all without having to re-introduce and resubmit the same data at each step with hidden input elements).

Things to read up on:

PHP Sessions:
http://php.net/manual/en/features.sessions.php

Extremely basic PHP form script (in case teedoff's linked example loses you):
http://www.w3schools.com/php/php_forms.asp

PHP form submission variables ($_GET, $_POST, and $_FILES) that are needed in order to handle submitted data and files:
http://php.net/manual/en/reserved.variables.get.php
http://php.net/manual/en/reserved.variables.post.php
http://php.net/manual/en/reserved.variables.files.php