So what is wrong with this code :

This is page 1 :

$MyFrett = new cFrett;

$_SESSION['cFrett'] = $MyFrett;

this is another page that is trying to use the class instance :

<?php
if (empty($_SESSION['cFrett']))
{
  echo 'the session object is empty';
}
else
{
  include("clsFrett.php");
  $MyFrett = new cFrett ;
  $MyFrett = $_SESSION['cFrett'];
  $MyFrett->NewNews();
}
?>


thanx
Palli


"Luis Ferro" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Yes, it is, but prior to accessing the stored value you will have to
include the class file, otherwise, php will not know what object that
thing in the session is...

LF

Palli wrote:

>Hello
>
>I´m wondering how I keep class instance alive between pages.  Is it
possible
>to store it in Session and what is the "right" way to store it globaly?
>
>thanx Palli
>
>
>
>
>


---
[This E-mail scanned for viruses by Declude Virus]




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

Reply via email to