topical media & game development
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 _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 _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 _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 _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 _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 _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 _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 _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 _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 sessid = session_id();
sessid'";
query)
or die (mysql_query());
row = mysql_fetch_array(row);
carttemp_prodnum'";
prod);
prod2);
extract(carttemp_quan;
echo "</td>";
echo "<td>";
echo "<a href=\"getprod.php?prodid=" .
products_prodnum . "\">";
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 + total, 2); ?></td>
<td></td>
<td></td>
</tr>
</table>
<input type="hidden" name="total" value="<?php echo
(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.