Re: [phplib] function works only the first time From: Stefan Jösch (sj <email protected>)
Date: 04/18/01

Using a large mallet, fabrizio.ermini <email protected> whacked out:
> 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!

Yes, you were right!!

Many Thanks,
        Stefan

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