RE: [PHP] Please help

From: Date: Thu, 10 May 2001 17:51:37 +0000
Subject: RE: [PHP] Please help
Groups: php.general 
Request: Send a blank email to php-general+get-52331@lists.php.net to get a copy of this message
I think this question was answered by Stewart Taylor earlier today. Here is his response: " This error occurrs when you start a session that recreates an object variable but does not know the class definition for it. You need to make sure you include the class source before you start the session. " Kirk > -----Original Message----- > From: Rodrigo Reis da Rocha [mailto:digo@irb-brasilre.com.br] > Sent: Thursday, May 10, 2001 11:44 AM > To: php-general@lists.php.net > Subject: [PHP] Please help > > > Hi, > I have a problem with the session variables. > > <? > > > class Autorizacao > { > > //Atributos--------------------------------------------------- > ---------------------------- > var $nome_usuario; > var $webmaster_mail; > var $acao; > var $url_sistema; > > > //Métodos----------------------------------------------------- > ---------------------------- > function Autorizacao(){ > $this->nome_usuario = "vazio"; > $this->webmaster_mail = "digo@irb-brasilre.com.br"; > $this->acao = "inicio"; > $this->url_sistema = "http://localhost/web/ "; > } > > function autorizaSistema($param_usuario, $param_passwd){ > //Verificar no banco se o usuario existe > $this->nome_usuario = $param_usuario; > } > } > > > session_start(); > > if (!session_is_registered("SISTEMA")){ > > //Registra a sessao > session_register("SISTEMA"); > $GLOBALS["SISTEMA"] = new Autorizacao(); > echo "Seta sistema"; > > } > > echo $GLOBALS["SISTEMA"]->url_sistema; > > echo "teste"; > > echo "<A href='in2.php'>reload</A>"; > ?> > > at the secons time that this code is executed generate this error. > > Fatal error: The script tried to execute a method or access a > property of an incomplete object. Please ensure that the > class definition autorizacao of the object you are trying to > operate on was loaded _before_ the session was started in > C:/XITAMI/webpages/WEB/in2.php on line 38 > > Please help > > Tkx. > R3.

« previous php.general (#52331) next »