scalar value as array problem

From: Date: Sun, 02 Nov 2003 22:44:41 +0000
Subject: scalar value as array problem
Groups: php.general 
Request: Send a blank email to php-general+get-168356@lists.php.net to get a copy of this message
I have a frustrating problem. I have a shopping cart class that creates session variable arrays to store the product_id and quantity. My development machine is running windows 2000 with PHP 4.3.3 and my script is working perfectly on my machine. When I upload to the remote host running FreeBSD and PHP 4.3.2 I am getting errors. I believe I am having problems with assigning the array values, and this is causing other problems. I am using this statment to assign $_SESSION['cart']['product_id'] with the quantity using a class with the add_item property. $cart->add_item($_GET['product_id'], $_GET['quantity']); I am getting this error. Warning: Cannot use a scalar value as an array in /home/designor/public_html/class.php on line 14 Warning: Cannot use a scalar value as an array in /home/designor/public_html/class.php on line 16 I have no idea what a scalar value even is. I did verify that my form was passing the values by using echo $_GET['product_id'] . $_GET['quantity']; Your help is much appreciated, as I am still a beginner. Steve Turner

« previous php.general (#168356) next »