Posted by Gale on 10/13/05 23:31
jimbojones230@gmail.com wrote:
> Hello,
>
> I'm attempting to pass all of the current values of an object to a new
> page using sessions. This is basically the code I've tried:
>
> page1.php
>
> <?php
> session_start();
> include "class.php";
> $object = new Class();
> $object->function();
> $_SESSION['object']=$object;
> ?>
>
> page2.php
> <?php
> session_start();
> include "class.php";
> $object = $_SESSION['object'];
> $object->function();
> ?>
>
> Can anyone tell me what I'm doing wrong, or if it's even possible to
> send an object using sessions? I get a fatal error when it tries to
> call the function on the second page.
>
> Thanks
>
you need to reinitialize tha class on second page, so I think you can't
send an object
[Back to original message]
|