'Mug', 2 => 'T-Shirt'); switch($_POST['action']) { case 'add': add(); break; case 'remove': remove(); break; default: index(); break; } function add() { $parts = explode('_', $_POST['id']); $id = (int)$parts[1]; $_SESSION['cart'][$id] ++; doCart(); return; } function doCart() { global $products; if(is_array($_SESSION['cart'])) { foreach($_SESSION['cart'] AS $item => $qty) { ?>
Product1 ()
CyberDummy - script.aculo.us php Cart Demo

Silly easy shopping

Drag products to the cart to fill it:

Mug T-Shirt

Your cart:

Drop items here to remove them from the cart.
View the source php code.
Comments