Re: SESSION Array problem - possibly different PHP versions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Put a print_r($_SESSION) at the top and bottom of your page code so you can see what's happening.

Also check your code that updates the session assignment by the GET value. It appears your code maybe unset()ing the session assignments.

Are you using Cookies? If so, check this code carefully as it can cause non obvious things depending on whether the client machine has cookies enabled or disabled.

Angelo Zanetti wrote:
Hi All,
I have a problem that only occurs on our live server and not our local
server.

It works fine locally.

Basically I am using a session array to store values of product colours. A
user can add colours to the session array.

The session is defined as follows:

$_SESSION['color'][$counter] = $color;

Obviously the first time we validate and the $counter is set to 0.

When more colours are added the $counter variable increments and should
increment the value of the array.

The colours are added through a popup window. Before I open the popup window
I print_r($_SESSION['color']) to view the contents of the array and make
sure that they are valid and it is an array.

Output is as follows:
[color] => Array ( [0] => #339933 [1] => #cccc00 ) etc...



Then once the popup opens I do the same print_r And it now shows: [color] => #339933
There fore it isn't an array of colors within the session array. How can PHP
change this? Also the strange thing is that locally it works fine but not
live. So I am guessing that there is a problem with a certain version of
PHP?

Also Im not sure what else could be causing this problem?

Any ideas or hints would be appreciated.

Thanks




Kind regards, Angelo Zanetti Application Developer
________________________________


Web: http://www.elemental.co.za


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux