Re: [phplib] function works only the first time From: fabrizio.ermini <email protected>
Date: 04/18/01

On 18 Apr 2001, at 15:42, Stefan Jösch wrote:

> <?php $cart->show_articles(); ?>
>
> This works on session initialisation time, i.e. the time when the session id
> is set, and only if the function is on the start page. After reloading the
> function prints nothing.
>

Because the object can't be extracted back from the session.

Remember that for storing an object in a session slot you have to
declare the "special" property $classname. So if you need to save
a My_Cart object in a session its definition should be:

class My_Cart extends Cart {

        var $classname = "My_Cart";

   function show_articles() {
     print "foo"
   }
 }

This way it should work as expected... I hope!

bye!
 
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Fabrizio Ermini Alternate E-mail:
C.so Umberto, 7 faermini <email protected>
loc. Meleto Valdarno Mail on GSM: (keep it short!)
52020 Cavriglia (AR) faermini <email protected>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>