basic-php-15-checkout2.php / php
<?php session_start(); //connect to the database _POST['same'] == 'on') { _POST['firstname']; _POST['lastname']; _POST['add1']; _POST['add2']; _POST['city']; _POST['state']; _POST['zip']; _POST['phone']; _POST['email']; } ?> <html> <head> <title>Step 2 of 3 - Verify Order Accuracy</title> </head> <body> Step 1 - Please Enter Billing and Shipping Information<br> <strong>Step 2 - Please Verify Accuracy and Make Any Necessary Changes</strong><br> Step 3 - Order Confirmation and Receipt<br> <form method="post" action=<checkout3.php>> <table width="300" border="1" align="left"> <tr> <td colspan="2" bgcolor="#0000FF"> <div align="center"><strong>Billing Information</strong></div> </td> </tr> <tr> <td width="50%"> <div align="right">First Name</div> </td> <td width="50%"> <input type="text" name="firstname" maxlength="15" value="<?php echo </td> </tr> <tr> <td width="50%"> <div align="right">Last Name</div> </td> <td width="50%"> <input type="text" name="lastname" maxlength="50" value="<?php echo _POST['lastname']; ?>"> </td> </tr> <tr> <td width="50%"> <div align="right">Billing Address</div> </td> <td width="50%"> <input type="text" name="add1" maxlength="50" value="<?php echo </td> </tr> <tr> <td width="50%"> <div align="right">Billing Address 2</div> </td> <td width="50%"> <input type="text" name="add2" maxlength="50" value="<?php echo _POST['add2']; ?>"> </td> </tr> <tr> <td width="50%"> <div align="right">City</div> </td> <td width="50%"> <input type="text" name="city" maxlength="50" value="<?php echo </td> </tr> <tr> <td width="50%"> <div align="right">State</div> </td> <td width="50%"> <input type="text" name="state" size="2" maxlength="2" value="<?php echo _POST['state']; ?>"> </td> </tr> <tr> <td width="50%"> <div align="right">Zip</div> </td> <td width="50%"> <input type="text" name="zip" maxlength="5" size="5" value="<?php echo </td> </tr> <tr> <td width="50%"> <div align="right">Phone Number</div> </td> <td width="50%"> <input type="text" name="phone" size="12" maxlength="12" value="<?php echo _POST['phone']; ?>"> </td> </tr> <tr> <td width="50%"> <div align="right">Fax Number</div> </td> <td width="50%"> <input type="text" name="fax" maxlength="12" size="12" value="<?php echo </td> </tr> <tr> <td width="50%"> <div align="right">E-Mail Address</div> </td> <td width="50%"> <input type="text" name="email" maxlength="50" value="<?php echo _POST['email']; ?>"> </td> </tr> </table> <table width="300" border="1"> <tr bgcolor="#990000"> <td colspan="2"> <div align="center"><strong>Shipping Information</strong></div> </td> </tr> <tr> <td width="50%"> <div align="right">Shipping Info same as Billing</div> </td> <td width="50%"> <input type="checkbox" name="same"></td> </tr> <tr> <td width="50%"> <div align="right">First Name</div> </td> <td width="50%"> <input type="text" name="shipfirst" maxlength="15" value="<?php echo </td> </tr> <tr> <td width="50%"> <div align="right">Last Name</div> </td> <td width="50%"> <input type="text" name="shiplast" maxlength="50" value="<?php echo _POST['shiplast']; ?>"> </td> </tr> <tr> <td width="50%"> <div align="right">Billing Address</div> </td> <td width="50%"> <input type="text" name="shipadd1" maxlength="50" value="<?php echo </td> </tr> <tr> <td width="50%"> <div align="right">Billing Address 2</div> </td> <td width="50%"> <input type="text" name="shipadd2" maxlength="50" value="<?php echo _POST['shipadd2']; ?>"> </td> </tr> <tr> <td width="50%"> <div align="right">City</div> </td> <td width="50%"> <input type="text" name="shipcity" maxlength="50" value="<?php echo </td> </tr> <tr> <td width="50%"> <div align="right">State</div> </td> <td width="50%"> <input type="text" name="shipstate" size="2" maxlength="2" value="<?php echo _POST['shipstate']; ?>"> </td> </tr> <tr> <td width="50%"> <div align="right">Zip</div> </td> <td width="50%"> <input type="text" name="shipzip" maxlength="5" size="5" value="<?php echo </td> </tr> <tr> <td width="50%"> <div align="right">Phone Number</div> </td> <td width="50%"> <input type="text" name="shipphone" size="12" maxlength="12" value="<?php echo _POST['shipphone']; ?>"> </td> </tr> <tr> <td width="50%"> <div align="right">E-Mail Address</div> </td> <td width="50%"> <input type="text" name="shipemail" maxlength="50" value="<?php echo </td> </tr> </table>
<table border="1" align="left" cellpadding="5"> <tr> <td>Quantity</td> <td>Item Image</td> <td>Item Name</td> <td>Price Each</td> <td>Extended Price</td> <td></td> <td></td> </tr> <?php sessid = session_id(); sessid'"; query) or die (mysql_query()); row = mysql_fetch_array(row); carttemp_prodnum'"; prod); prod2); extract(<tr><td>"; echo carttemp_quan; echo "</td>"; echo "<td>"; echo "<a href=\"getprod.php?prodid=" . <br>IMAGE</td></a>"; echo "<td>"; echo "<a href=\"getprod.php?prodid=" . products_prodnum . "\">"; echo </td></a>"; echo "<td align=\"right\">"; echo products_price; echo "</td>"; echo "<td align=\"right\">"; //get extended price products_price * extprice; echo "</td>"; echo "<td>"; echo "<a href=\"cart.php\">Make Changes to Cart</a>"; echo "</td>"; echo "</tr>"; //add extended price to total extprice + <tr> <td colspan="4" align="right">Your total before shipping is:</td> <td align="right"> <?php echo number_format(total, 2); ?></td> <td></td> <td></td> </tr> </table> <input type="hidden" name="total" value="<?php echo <p> <input type="submit" name="Submit" value="Send Order -->"> </p> </form> </body> </html>
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.