Fatal error: Cannot increment/decrement overloaded

Hello,

Got a weird problem.. I moved my site to a new hosting company. It is written for php5. On the surface, after making the necessary changes to reflect mysql database everything seems to be working. But in testing the shopping cart feature, I am getting odd error messages.

I am able to add the first item to the cart, but if i were to increase the quantity and save from the cart.php page I get: Warning: array_count_values() [function.array-count-values]: The argument should be an array in cart.php line 73.

if($_SESSION['cart']&&array_count_values($_SESSION['cart']))
display_cart($_SESSION['cart']);
else

If I were to go back to catagories and add a different item to the cart, I get

Fatal error: Cannot increment/decrement overloaded objects nor string offsets in /home/xxxx/public_html/cart.php on line 19

if(isset($_SESSION['cart'][$new]))
(19) $_SESSION['cart'][$new]++;
else
$_SESSION['cart'][$new] = 1;

How to duplicate.

<!-- w --><a class="postlink" href="http://www.nystixs.com/models.php?catid=1">www.nystixs.com/models.php?catid=1</a><!-- w --> (click any model link, next page click "add to cart" )

On the next page, change qty, click save, you will get first error.

Go back to <!-- w --><a class="postlink" href="http://www.nystixs.com/models.php?catid=1">www.nystixs.com/models.php?catid=1</a><!-- w -->, choose a different model, select and "Add to Cart" and u will get

Fatal error: Cannot increment/decrement overloaded objects nor string offsets in /home/nystixsc/public_html/cart.php on line 19


I think something is wrong with the $_SESSION properties. I am moving the site from my Solaris box to linux.. (php config <!-- w --><a class="postlink" href="http://www.nystixs.com/test1.php">www.nystixs.com/test1.php</a><!-- w -->) Seems like something is not enabled. I reset all IE settings, but had samer result.

Anyone, direction will be greatly appreciated.

-AndreHi,

is external access to a phpinfo script on your solaris box possible ?

I saw that register_globals is enabled on the new box. That might cause problems (espacially if you use a variable named $cart in your script.

What kind of values do you assign $new ? Please post more code if possible (maybe as attachment)

Regards,
ThomasHey Thomas,

I just woke up and the first thought that came to my mind is the register_global. I just turned it off and will test.. I would have to go to where the sun box is and look at it.. But I am positive that the option is turned off, I remember from my reading.

-AndreIt seems like the site is working properly now.. Thanks. I will reachout if I have anymore problems.
 
Back
Top