topical media & game development
basic-php-15-cart.php / php
<?php
if (!session_id()) {
session_start();
}//connect to the database
sessid = session_id();
//display number of products in cart
sessid'";
query)
or die (mysql_query());
results);
echo total = 0;
while (results)) {
echo "<tr>";
extract(prod = "SELECT * FROM products " .
"WHERE products_prodnum='prod2 = mysql_query(prod3 = mysql_fetch_array(prod3);
echo "<td>
<form method=\"POST\" action=\"modcart.php?action=change\">
<input type=\"hidden\" name=\"modified_hidden\"
value=\"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 "<input type=\"submit\" name=\"Submit\"
value=\"Change Qty\">
</form></td>";
echo "<td>";
echo "<form method=\"POST\" action=\"modcart.php?action=delete\">
<input type=\"hidden\" name=\"modified_hidden\"
value=\"total = total;
}
?>
<tr>
<td colspan=\"4\" align=\"right\">
Your total before shipping is:</td>
<td align=\"right\"> <?php echo number_format(carttemp_hidden)) {
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.