I'm trying to make a simple shopping cart using Session variables. However, I for each item, I need to store 3 varaibles: quantity, catID, item. (The DB is so big I had to break everything into different tables so I need to know which table aka catID to query upon checkout).
Here's what I've got so far:
// addToCat.php?catID=11&item=5
session_start();
header("Cache-control: private");
include "includes/connect.php";
if(!$_SESSION['cart'])
$_SESSION['cart'] = array();
$_SESSION['cart'][] = $catID;
$_SESSION['cart'][$catID][] = $item;
echo $_SESSION['cart']."<br>";
My question is... am I doing anything right here? How do I output all the info saved in the Session variable array "cart"???
Thanks.