I'm writing a shopping cart from scratch. To save my variables from script to script, I've decided to define a session array. Here is the defintion:
$_SESSION["product"] = array(
"model" => $model,
"qty" => $qty,
"price" => $price,
"color" => $color1,
"image" => $image
);
I'm passing the variables from a previous script that shows the catalog. I want to be able to update the array dynamically each time a new product is added to the shopping cart, but I'm having trouble with the code. I guess I'm using this array as kind of a record and I want to be able to address each 'record' and print it out.
I know I can also write a user file to the MySQL database and I will do that if I can't get my code resolved. I don't want to use cookies since a lot of people have cookies turned off.
Or should I just use a multi-dimensional array?
Thanks for any help you can give me.