[eluser]Unknown[/eluser]
Hi all,
I'm working on a login system but I get a fatal error in my model.
I autoloaded the session class in de autoload file.
I also already put values into the session, so i can't see why it isn't working.
The error:
Fatal error: Can't use method return value in write context in F:\Scripting Envoirment\Xampp\htdocs\Marketing site\application\models\login.php on line 15
Thanks in advance,
Paul du Long
model/login.php
Code:
<?php
class Login extends Model{
function Login(){
parent::Model();
}
function setLvl($lvl)
{
if( isSet($lvl) )
{
if( isSet( $this -> session -> userdata('type') ) && isSet( $this -> session -> userdata('userid') ) )
{
if( $this -> session -> userdata('type') == $lvl )
{
define('userType', $this -> session -> userdata('type') );
define('userId', $this -> session -> userdata('userid') );
}else{
redirect('reLogin');
}
}else
{
redirect('reLogin');
}
}else
{
redirect('reLogin');
}
}
}
?>
controller/publishers.php
Code:
<?php
class Publishers extends Controller {
function Publishers()
{
parent::Controller();
$this -> load -> model('login');
$this -> login -> setLvl('1');
}
function index()
{
echo 'Userid: ' . userId .'<br/>';
echo 'Type: ' . userType .'<br/>';
//$this -> template -> load('modal','publishers');
}
}