Slodge Posted September 2, 2006 Share Posted September 2, 2006 Can u guys tell me how to do this.1. An order form which which sent the order details to me using html and the sent the same order details to the person filling up the order form 2. An order form having 2 pages. First page contains Order item, Order code and Payment type, and after filling the three , user have to click continue to fill up for his address and other things. Quote Link to comment https://forums.phpfreaks.com/topic/19514-order-form/ Share on other sites More sharing options...
AndyB Posted September 2, 2006 Share Posted September 2, 2006 #1 - see the manual page about the mail() function.#2 - retrieve the data passed by the first form (if the form method is 'post', read the $_POST array variables) and enter them in hidden fields in the second form Quote Link to comment https://forums.phpfreaks.com/topic/19514-order-form/#findComment-84830 Share on other sites More sharing options...
Slodge Posted September 2, 2006 Author Share Posted September 2, 2006 I dont now much about php, can u give me some idea, hint or an example code .... Quote Link to comment https://forums.phpfreaks.com/topic/19514-order-form/#findComment-84837 Share on other sites More sharing options...
AndyB Posted September 2, 2006 Share Posted September 2, 2006 You first. Show us the first form, show us the second form (preferably without too much of the html junk that's nothing to do with the real forms code) Quote Link to comment https://forums.phpfreaks.com/topic/19514-order-form/#findComment-84850 Share on other sites More sharing options...
Slodge Posted September 2, 2006 Author Share Posted September 2, 2006 Here is the first form[quote]<form name="form1" method="post" action=""> <table width="29%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="53%">Product Code</td> <td width="47%"><input name="productcode" type="text" id="productcode"></td> </tr> <tr> <td>Product Item</td> <td><input name="productitem" type="text" id="productitem"></td> </tr> <tr> <td>Payment Type</td> <td> <select name="select" size="1"> <option value="Paypal" selected>Paypal</option> <option value="Money Order">Money Order</option> <option value="Demand Draft">Demand Draft</option> </select> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td><input name="Next" type="button" id="Next" value="Next"></td> </tr> </table></form>[/quote]And the Second[quote]<form name="form1" method="post" action=""> <table width="29%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="53%" height="24">Name</td> <td width="47%"><input name="Name" type="text" id="Name"></td> </tr> <tr> <td>Address</td> <td><input name="Address" type="text" id="Address"></td> </tr> <tr> <td>City</td> <td><input name="City" type="text" id="City"> </td> </tr> <tr> <td>State</td> <td><input name="State" type="text" id="State"></td> </tr> <tr> <td>Pin</td> <td><input name="Pin" type="text" id="Pin"></td> </tr> <tr> <td>Phone</td> <td><input name="Phone" type="text" id="Phone"></td> </tr> <tr> <td>Email </td> <td><input name="Email" type="text" id="Email"></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td><input type="reset" name="Reset" value="Reset"></td> <td><input type="submit" name="Submit2" value="Submit"></td> </tr> </table></form>[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/19514-order-form/#findComment-84860 Share on other sites More sharing options...
AndyB Posted September 2, 2006 Share Posted September 2, 2006 Here's the low budget version of what comes next. It should help:Edit the first form so that the action point to the second form (and the second form will need to be named with a .php extension).[code]<form name="form1" method="post" action="my_second_form.php">[/code]Edit the second form (whose file name matches whatever you used in the first form's action=) so that the form part begins like this:[code]<form name="form1" method="post" action="my_form_mail_script.php"><?php// retrieve data from the first form$productcode = $_POST['productcode'];$productitem = $_POST['productitem'];$payment = $_POST['select'];// now add those to hidden field for passing along furtherecho "<input type='hidden' name='productcode' value='". $productcode. "'/>\n";echo "<input type='hidden' name='productitem' value='". $productitem. "'/>\n";echo "<input type='hidden' name='payment' value='". $payment. "'/>\n";?>... the rest of your second form goes here[/code]Now create a new script named my_form_mail_script.php that looks like this:[code]<?php$productcode = $_POST['productcode'];$productitem = $_POST['productitem'];$payment = $_POST['select'];// do the same with the other fields in the second form// now you have all the passed data so make it a 'message'$msg = "Product code: ". $productcode. "\n";$msg.= "Product item: ". $productitem. "\n";// keep going building the message// see the manual for how to send mail using the mail function.?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/19514-order-form/#findComment-84881 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.