That's exactly what I was trying to do - redirect the user back to the home page (index.html) and they can go from there... where do I find out how to "style it using CSS"? (I'm a noob at CSS also, but I do know other languages). Here is the complete code for the View Cart page:
<?php
session_start();
define("PRODUCTCODE", 0);
define("PRODUCTNAME", 1);
define("QUANTITY", 2);
define("PRICE", 3);
define("URL",4);
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
if (isset($_POST['productcode']))
{
AddToCart();
}
else {
$action = isset($_POST['action']) ? $_POST['action'] : '';
$value = strtoupper(substr($action, 0, 5));
echo $value;
switch ($value)
{
// continue shopping
case "CONTI":
header("Location: "."index.html");
// header("Location" ".$GET['referringURL']);
break;
// recalculate
case "RECAL":
RecalculateCart();
break;
// proceed to checkout
case "CHECK":
header("Location: "."customer.php");
break; }
} }
function AddToCart()
{
$cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : '';
$itemcount = isset($_SESSION['itemcount']) ? $_SESSION['itemcount'] : 0;
$cart[PRODUCTCODE][$itemcount] = $_POST['productcode'];
$cart[PRODUCTNAME][$itemcount] = $_POST['productname'];
$cart[QUANTITY][$itemcount] = intval($_POST['quantity']);
$cart[PRICE][$itemcount] = $_POST['price'];
$itemcount = $itemcount + 1;
$_SESSION['cart'] = $cart;
$_SESSION['itemcount'] = $itemcount;
}
function RecalculateCart()
{
$cart = isset($_SESSION['cart']) ? $_SESSION['cart'] : '';
$itemcount = isset($_SESSION['itemcount']) ? $_SESSION['itemcount'] : 0;
for ($i=0; $i<$itemcount; $i++)
{
$quantity = $_POST['quantity'.($i)];
if (empty($quantity))
{
$quantity = 0;
}
else
if (($quantity < 0) || (!is_numeric($quantity)))
{
$quantity = 0;
}
$cart[QUANTITY][$i] = intval($quantity);
}
for ($j=0; $j<$itemcount; $j++)
{
$quantity = $cart[QUANTITY][$j];
// remove item from the cart
if ($quantity == 0)
{
$itemcount--;
$curitem = $j;
while(($curitem+1) < count($cart[0]))
{
for ($k=0; $k<4; $k++)
{
$cart[$k][$curitem] = $cart[$k][$curitem+1];
$cart[$k][$curitem+1] = '';
}
$curitem++;
}
} }
$_SESSION['itemcount'] = $itemcount;
$_SESSION['cart'] = $cart;
}
?>