multiple page forms
Moderator: General Moderators
- burnhallian
- Forum Commoner
- Posts: 28
- Joined: Tue Jul 12, 2005 2:47 am
multiple page forms
dear all !
can anyone help me how to make a form with multiple pages. I would use different tables so with the id from first table then i will insert data from formsinto other tables using the same id. but im not sure how to do that and how to pass on the id. can some help me out or does anyone have something related to this that can help me ?
thanx
can anyone help me how to make a form with multiple pages. I would use different tables so with the id from first table then i will insert data from formsinto other tables using the same id. but im not sure how to do that and how to pass on the id. can some help me out or does anyone have something related to this that can help me ?
thanx
Hmm.. why would a form need multiple pages?
Perhaps like a multi-step form.. like complete step 1, then go on to step 2, etc..
Or maybe you mean, submit a form, then process/show results on a different page.
Either way there are several methods to retain the ID #.
You could take a variable onto your URL ($_GET)
You could just post the data, including the id ($_POST)
You could even store in a database and retrieve it on the next page
Perhaps like a multi-step form.. like complete step 1, then go on to step 2, etc..
Or maybe you mean, submit a form, then process/show results on a different page.
Either way there are several methods to retain the ID #.
You could take a variable onto your URL ($_GET)
You could just post the data, including the id ($_POST)
You could even store in a database and retrieve it on the next page
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- burnhallian
- Forum Commoner
- Posts: 28
- Joined: Tue Jul 12, 2005 2:47 am
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
whenever you want to save the info for another form, use a hidden input field
Code: Select all
<input type='hidden' name='id' value='<?php echo $_POST['id']; ?>'>- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Scrotaye hit it on the nail.scrotaye wrote:Hmm.. why would a form need multiple pages?
You could take a variable onto your URL ($_GET)
You could just post the data, including the id ($_POST)
You could even store in a database and retrieve it on the next page
I generally don't like to store things in hidden fields, because I simply don't trust the client side aspect of my applications
Code: Select all
$_SESSION['steps'][1] = array(
'username' => $_POST['username'],
'email' => $_POST['email'],
);Code: Select all
$_SESSION['steps'][2] = array(
'address' => $_POST['address'],
'address' => $_POST['address'],
);To determine what step the form is on, I would be passing on a $_GET variable and depending on what the value of this variable, load appropriate forms.
http://localhost/formtest.php?step=1
To determine how to execute specific blocks of code, you should look into switch() or if()
A simple version would look like
Code: Select all
//check to see if step variable exists
$step = (isset($_GET['step']) ? (int)$_GET['step'] : 0);
switch ($step) {
case (0) {
//display first step
break;
case (1) {
//display second step
break;
case (2) {
//display third step
break;
}- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
look mybee you can help me because i am not to good with php.
i have these 2 formsl.
form 1
and i also have this one
they need to be seperated but come back as one email. i just need to know exactly what i have to put on the pages. besides the form and stuff. thanks!
i have these 2 formsl.
form 1
Code: Select all
<form action="http://wsc1.nyesonline.net/processors/order.php" method="post">
<tbody>
<tr>
<td WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="TOP">
<p ALIGN="CENTER"><b><font SIZE="2"><font FACE="Georgia">Qty</font></font></b></p>
</td>
<td WIDTH="10%" BGCOLOR="#F5DEB3" VALIGN="TOP">
<p ALIGN="CENTER"><b><font SIZE="2"><font FACE="Georgia">Item #</font></font></b></p>
</td>
<td WIDTH="73%" BGCOLOR="#F5DEB3" VALIGN="TOP">
<p ALIGN="CENTER"><b><font SIZE="2"><font FACE="Georgia">Description</font></font></b></p>
</td>
<td WIDTH="12%" BGCOLOR="#F5DEB3" VALIGN="TOP">
<p ALIGN="CENTER"><b><font SIZE="2"><font FACE="Georgia">Price Each</font></font></b></p>
</td>
</tr>
<tr>
<td WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER"><input TYPE="TEXT" NAME="qty1" SIZE="3" MAXLENGTH="2" /></p>
</center></td>
<td WIDTH="10%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product1a" SIZE="5" MAXLENGTH="8" /></p>
</center></td>
<td WIDTH="73%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product1b" SIZE="100" MAXLENGTH="250" /></p>
</center></td>
<td WIDTH="12%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER"><font FACE="Georgia">$<input TYPE="TEXT" NAME="price1" SIZE="7" MAXLENGTH="6" /></font></p>
</center></td>
</tr>
<tr>
<td WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER"><input TYPE="TEXT" NAME="qty2" SIZE="3" MAXLENGTH="2" /></p>
</center></td>
<td WIDTH="10%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product2a" SIZE="5" MAXLENGTH="8" /></p>
</center></td>
<td WIDTH="73%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product2b" SIZE="100" MAXLENGTH="250" /></p>
</center></td>
<td WIDTH="12%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER"><font FACE="Georgia">$<input TYPE="TEXT" NAME="price2" SIZE="7" MAXLENGTH="6" /></font></p>
</center></td>
</tr>
<tr>
<td WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER"><input TYPE="TEXT" NAME="qty3" SIZE="3" MAXLENGTH="2" /></p>
</center></td>
<td WIDTH="10%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product3a" SIZE="5" MAXLENGTH="8" /></p>
</center></td>
<td WIDTH="73%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product3b" SIZE="100" MAXLENGTH="250" /></p>
</center></td>
<td WIDTH="12%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER"><font FACE="Georgia">$<input TYPE="TEXT" NAME="price3" SIZE="7" MAXLENGTH="6" /></font></p>
</center></td>
</tr>
<tr>
<td WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER"><input TYPE="TEXT" NAME="qty4" SIZE="3" MAXLENGTH="2" /></p>
</center></td>
<td WIDTH="10%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product4a" SIZE="5" MAXLENGTH="8" /></p>
</center></td>
<td WIDTH="73%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product4b" SIZE="100" MAXLENGTH="250" /></p>
</center></td>
<td WIDTH="12%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER"><font FACE="Georgia">$<input TYPE="TEXT" NAME="price4" SIZE="7" MAXLENGTH="6" /></font></p>
</center></td>
</tr>
<tr>
<td WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER"><input TYPE="TEXT" NAME="qty5" SIZE="3" MAXLENGTH="2" /></p>
</center></td>
<td WIDTH="10%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product5a" SIZE="5" MAXLENGTH="8" /></p>
</center></td>
<td WIDTH="73%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product5b" SIZE="100" MAXLENGTH="250" /></p>
</center></td>
<td WIDTH="12%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER"><font FACE="Georgia">$<input TYPE="TEXT" NAME="price5" SIZE="7" MAXLENGTH="6" /></font></p>
</center></td>
</tr>
<tr>
<td WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER"><input TYPE="TEXT" NAME="qty6" SIZE="3" MAXLENGTH="2" /></p>
</center></td>
<td WIDTH="10%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product6a" SIZE="5" MAXLENGTH="8" /></p>
</center></td>
<td WIDTH="73%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product6b" SIZE="100" MAXLENGTH="250" /></p>
</center></td>
<td WIDTH="12%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER"><font FACE="Georgia">$<input TYPE="TEXT" NAME="price6" SIZE="7" MAXLENGTH="6" /></font></p>
</center></td>
</tr>
<tr>
<td WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER"><input TYPE="TEXT" NAME="qty7" SIZE="3" MAXLENGTH="2" /></p>
</center></td>
<td WIDTH="10%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product7a" SIZE="5" MAXLENGTH="8"></p>
</center></td>
<td WIDTH="73%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product7b" SIZE="100" MAXLENGTH="250" /></p>
</center></td>
<td WIDTH="12%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER"><font FACE="Georgia">$<input TYPE="TEXT" NAME="price7" SIZE="7" MAXLENGTH="6" /></font></p>
</center></td>
<tr>
<td WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER"><input TYPE="TEXT" NAME="qty8" SIZE="3" MAXLENGTH="2" /></p>
</center></td>
<td WIDTH="10%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product8a" SIZE="5" MAXLENGTH="8"></p>
</center></td>
<td WIDTH="73%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product8b" SIZE="100" MAXLENGTH="250" /></p>
</center></td>
<td WIDTH="12%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER"><font FACE="Georgia">$<input TYPE="TEXT" NAME="price8" SIZE="7" MAXLENGTH="6" /></font></p>
</center></td>
</tr>
<tr>
<td WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER"><input TYPE="TEXT" NAME="qty9" SIZE="3" MAXLENGTH="2" /></p>
</center></td>
<td WIDTH="10%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product9a" SIZE="5" MAXLENGTH="8"></p>
</center></td>
<td WIDTH="73%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product9b" SIZE="100" MAXLENGTH="250" /></p>
</center></td>
<td WIDTH="12%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER"><font FACE="Georgia">$<input TYPE="TEXT" NAME="price9" SIZE="7" MAXLENGTH="6" /></font></p>
</center></td>
</tr>
<tr>
<td WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER"><input TYPE="TEXT" NAME="qty10" SIZE="3" MAXLENGTH="2" /></p>
</center></td>
<td WIDTH="10%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product10a" SIZE="5" MAXLENGTH="8"></p>
</center></td>
<td WIDTH="73%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product10b" SIZE="100" MAXLENGTH="250" /></p>
</center></td>
<td WIDTH="12%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER"><font FACE="Georgia">$<input TYPE="TEXT" NAME="price10" SIZE="7" MAXLENGTH="6" /></font></p>
</center></td>
</tr>
<tr>
<td WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER"><input TYPE="TEXT" NAME="qty11" SIZE="3" MAXLENGTH="2" /></p>
</center></td>
<td WIDTH="10%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product11a" SIZE="5" MAXLENGTH="8"></p>
</center></td>
<td WIDTH="73%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product11b" SIZE="100" MAXLENGTH="250" /></p>
</center></td>
<td WIDTH="12%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER"><font FACE="Georgia">$<input TYPE="TEXT" NAME="price11" SIZE="7" MAXLENGTH="6" /></font></p>
</center></td>
</tr>
<tr>
<td WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER"><input TYPE="TEXT" NAME="qty12" SIZE="3" MAXLENGTH="2" /></p>
</center></td>
<td WIDTH="10%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product12a" SIZE="5" MAXLENGTH="8"></p>
</center></td>
<td WIDTH="73%" BGCOLOR="#F5DEB3" VALIGN="TOP"><center>
<p ALIGN="CENTER">
<input TYPE="TEXT" NAME="product12b" SIZE="100" MAXLENGTH="250" /></p>
</center></td>
<td WIDTH="12%" BGCOLOR="#F5DEB3" VALIGN="CENTER"><center>
<p ALIGN="CENTER"><font FACE="Georgia">$<input TYPE="TEXT" NAME="price12" SIZE="7" MAXLENGTH="6" /></font></p>
</center></td>
</tr>
</tr>
<tr>
<td COLSPAN="2" WIDTH="5%" BGCOLOR="#F5DEB3" VALIGN="TOP">
</td>
<td COLSPAN="2" BGCOLOR="#F5DEB3" VALIGN="CENTER">
<div ALIGN="RIGHT">
<p ALIGN="RIGHT">
<input TYPE="SUBMIT" VALUE="Send Order!!!" />
</form>Code: Select all
<form METHOD="POST" ACTION="http://wsc1.nyesonline.net/processors/team.php">
Name: <input type="text" name="name"> <br>
Address: <input type="text" name="address"> <br>
Phone Number: <input type="text" name="phone"> <br>
E-Mail Address: <input type="text" name="email"> <br>
Comments: <br> <TEXTAREA NAME="comments" ROWS=6 COLS=40>
</TEXTAREA><br>
<input type="submit" value="Submit"> <input type="reset" value="Reset">
</form>