Fatal error: Call to a member function on a non-object in /path/trust_survey.php on line 5
Here is the code for that part:
<?
require('../includes/config.php');
//include site header
if(!isset($_POST['submit']) || !isset($_POST['submit1'])) include('./survey_templates/header.php');
if(!$user->checkuser()) { header('Location: [url]http://www.cal-trusts.com/login.php[/url]'); }
Now this would seem that my class for checking the user isnt working properly, but it also extends to my mySQL class, which gives me the same problem whenever i use $db->query() etc. I can post the class if that would help, here is the snippet for the checkuser() part:
function checkuser() {
//Check if session exist
if(isset($_SESSION['uid']) && isset($_SESSION['upass'])) {
$query = 'SELECT * FROM '.DBT_USERS.' WHERE user_id = '.$_SESSION['uid']." AND user_passwd = '".$_SESSION['upass']."'";
$results = $this->db->query($query);
if(!$this->db->num_rows($results)) return false;
else return true;
} else {
return false;
}
}
Any ideas??