First of all, here is my code:
<?php
if (!isset($quantity) OR $quantity == "0"){
die("<body bgcolor='FF0000'><font face=verdana color='FFFFFF'>You have no items in your shopping cart.");
}
if (!isset($cookie_cart)){
$cookie_cart = array();
}
$string = $quantity . "x " . $size . " " . $item;
$cookie_cart[] = $string;
setcookie("cookie_cart", $cookie_cart, time()+600);
print "<body bgcolor='FF0000'>\n<font face='verdana' color='FFFFFF'>";
for ($i = 0; $i < count($cookie_cart); $i++) {
print "$cookie_cart[$i] <a href='order_bottom.php?request=remove&rid=$i'>";
print "<img src='images/-.gif' border=0 height=20 width=20></a><br>";
}
?>
I get an error where the code reads "$cookie_cart[] ...". The error reads as follows: " Fatal error: [] operator not supported for strings ". This of course makes no sense to me. $cookie_cart is not a string, it is an array. The first time this script loads it is initialized as an array, and then set as a cookie. I have been puzzling over this for a while and have no idea where the error is! Please help!
Thanks