I have problem with a simple login script, keep getting message "Call to a member function on a non-object". The same code worked locally, but when i tried to run it online i got this message.
have two php files:login.php and connect.php
here is simplified code from connect.php
class Connect{
var $logged;
function check_login($uname, $pass){
$this->logged=true; // works - i checked with die() function
$this->set_session(logged', true); //works
..
}
function simple(){
return $_SESSION['data'];
}
}
$user=new Connect;
here is the code from user.php
include_once('connect.php');
$user->check_login($uname, $pass); // works
var_dump($user->logged); // i get NULL - why!?
$loggedin=$user->get_session('logged'); // i get the error message "call to a member function on a non-object
$data=$user->simple();