Hey guys,
I'm using php4 and trying to implement a simple shopping cart with PHP sessions. First, I tried using a shopping cart object that stores several item objects in an array, each item object with properties like product id, product name, etc.
However, because PHP sessions do not work correctly support objects, the item objects are all lost. So I started storing the items in a two-dimensional array. However, it appears the data in the array is lost when I try to get it back as well.
I know member functions are lost and I handle that appropriate by creating a new object with the same name as the one stored in the session right before the call to session_start..that's no problem.
But why is the data lost when I put it an array? How am I supposed to write a shopping cart using PHP sessions?? Anyone?
Thanks,
Sonny