Problems with session
| From: | Rodrigo Reis da Rocha | Date: | Thu, 10 May 2001 16:03:29 +0000 |
| Subject: | Problems with session | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-52312@lists.php.net to get a copy of this message | ||
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.