I am totally new in web programming. Maybe my question sounds so silly for some of you, but i just wanna ask how to program forms in php which will accept multiple steps? For example form 1 post to form 2 then the consolidated results from both forms are posted via one email to the user? Basically i have a registration form, and then a billing form. So, i will need to send an email to the user about all the information that they have input in both forms. Currently i am using two forms which will send two different emails to the user. So, can anyone tell me how can i send only one email but the inputs are from two different forms? Thank you in advance
One confirmation email, two different forms.
Moderator: General Moderators
-
sisleysusie
- Forum Newbie
- Posts: 16
- Joined: Wed Jan 14, 2004 9:44 pm
One confirmation email, two different forms.
Hi everyone,
I am totally new in web programming. Maybe my question sounds so silly for some of you, but i just wanna ask how to program forms in php which will accept multiple steps? For example form 1 post to form 2 then the consolidated results from both forms are posted via one email to the user? Basically i have a registration form, and then a billing form. So, i will need to send an email to the user about all the information that they have input in both forms. Currently i am using two forms which will send two different emails to the user. So, can anyone tell me how can i send only one email but the inputs are from two different forms? Thank you in advance
I am totally new in web programming. Maybe my question sounds so silly for some of you, but i just wanna ask how to program forms in php which will accept multiple steps? For example form 1 post to form 2 then the consolidated results from both forms are posted via one email to the user? Basically i have a registration form, and then a billing form. So, i will need to send an email to the user about all the information that they have input in both forms. Currently i am using two forms which will send two different emails to the user. So, can anyone tell me how can i send only one email but the inputs are from two different forms? Thank you in advance
-
ilovetoast
- Forum Contributor
- Posts: 142
- Joined: Thu Jan 15, 2004 7:34 pm
There are several ways to do this.
First you could use sessions. Place all of the data from the first form into session vars and then combine those with the data from form 2 after the submission of form 2.
Another easier way (but with some privacy and kludge concerns) is to put the values from form 1 into a bunch of hidden form fields on form 2. Then they'll get passed on again when form 2 submits.
Sessions are best IMHO, so use them if you can. There are a number of good session references and tutorials around here if you do a search. Plus the PHP manual has solid info as well.
peace
First you could use sessions. Place all of the data from the first form into session vars and then combine those with the data from form 2 after the submission of form 2.
Another easier way (but with some privacy and kludge concerns) is to put the values from form 1 into a bunch of hidden form fields on form 2. Then they'll get passed on again when form 2 submits.
Sessions are best IMHO, so use them if you can. There are a number of good session references and tutorials around here if you do a search. Plus the PHP manual has solid info as well.
peace
-
sisleysusie
- Forum Newbie
- Posts: 16
- Joined: Wed Jan 14, 2004 9:44 pm
So does it mean that i only need to add codes like below in my form1 and then link to form2? Do i need to use session as well in form2? Or i only need to use normal html code? Thank you in advance
Code: Select all
<?php
session_start();
$HTTP_SESSION_VARS['courses_registered'] = $HTTP_POST_VARS['Courses_Registered'];
$HTTP_SESSION_VARS['FirstName'] = $HTTP_POST_VARS['FistName'];
$HTTP_SESSION_VARS['LastName'] = $HTTP_POST_VARS['LastName'];
$HTTP_SESSION_VARS['Salutations'] = $HTTP_POST_VARS['Salutations'];
$HTTP_SESSION_VARS['Gender'] = $HTTP_POST_VARS['Gender'];
$HTTP_SESSION_VARS['Citizenship'] = $HTTP_POST_VARS['CountryofCitizenship']
$HTTP_SESSION_VARS['DOB'] = $HTTP_POST_VARS['DOB'];
?>-
sisleysusie
- Forum Newbie
- Posts: 16
- Joined: Wed Jan 14, 2004 9:44 pm