ChaiBearx3 Posted March 13, 2014 Share Posted March 13, 2014 Notice: Undefined property: SessionData::$authData in /home/paulmc1/xxx/SessionData.php on line 40 Notice: Undefined property: SessionData::$authData in /xxx/SessionData.php on line 41 Notice: Undefined property: SessionData::$authData in /xxx/SessionData.php on line 42 Notice: Undefined index: HTTP_REFERER in /xxx/index.php on line 16 Notice: Undefined property: SessionData::$authData in /xxx/SessionData.php on line 40 Notice: Undefined property: SessionData::$authData in /xxx/SessionData.php on line 41 Notice: Undefined property: SessionData::$authData in /xxx/SessionData.php on line 42 Not sure why I'm getting this error. I've already tried troubleshooting it and just ended up failing. Here's my code: SessionData.PHP <?PHP //Error Checking ini_set('display_errors',1); error_reporting(E_ALL); class SessionData{ function __construct($page = 'default'){ $this->SetSession($page); } public function SetSession($page = 'default'){ $currentCookieParams = session_get_cookie_params(); $rootDomain = 'kuarrel.tk'; session_set_cookie_params( $currentCookieParams["lifetime"], $currentCookieParams["path"], $rootDomain, $currentCookieParams["secure"], $currentCookieParams["httponly"] ); //session_start(); if(isset($_SESSION['authData'])){ $this->authData = $_SESSION['authData']; } if(isset($_SESSION['authData'])){ if($_SESSION['authData']['accountstatus']=="-1" && $page=="default"){ echo $page; header("Location: account.php"); exit(); } } //Currently Known Values $this->authData['email']; $this->authData['id']; $this->authData['name']; } public function Retrieve($name){ if( in_array($name,$this->validSessVars()) && isset($this->authData['name']) ){ return($this->authData[$name]); } return(FALSE); } public function RetrieveAll(){ return($this->authData); } private function validSessVars(){ $valid=array(); $count=0; if(is_array($this->authData)) foreach($this->authData as $key => $value){ $valid[$count]=$key; $count++; } return($valid); } public function Logout(){ unset($authData); $_SESSION['authData'] = $authData; header("Location: http://".$_SERVER["HTTP_HOST"]."/index.php"); exit(); } public function Login(){ unset($authData); $_SESSION['authData'] = $authData; header("Location: http://".$_SERVER["HTTP_HOST"]."/login.php"); exit(); } public function CheckValidSession(){ if(isset($_SESSION['authData'])){ $this->authData = $_SESSION['authData']; if(is_array($this->authData)&&$this->authData['id']>0){ return(TRUE); } return(FALSE); } } public function CheckValidFBSession(){ if (!$this->CheckValidSession()){ header('location: bind.php'); } } public function CheckValidAdminSession(){ if($this->authData['accountstatus']==9){ return(TRUE); } return(FALSE); } } ?> Quote Link to comment Share on other sites More sharing options...
ginerjm Posted March 14, 2014 Share Posted March 14, 2014 Where are your classes properties defined? Quote Link to comment Share on other sites More sharing options...
ChaiBearx3 Posted March 14, 2014 Author Share Posted March 14, 2014 Alright, I've fixed those errors but now I'm getting this... Fatal error: Class 'MongoClient' not found in /xxx/Log.php on line 25 Log.PHP: <?PHP //Error Checking ini_set('display_errors',1); error_reporting(E_ALL); class log{ public function __construct($page, $get= '', $post = '', $ref = '') { $sess = new SessionData('account'); if($sess->CheckValidSession()){ $userid=$sess->Retrieve('id'); }else{ $userid="0"; } if($userid=='45403199'){ return false; } if(!$ref) $ref=""; $ip=$_SERVER["REMOTE_ADDR"]; $values=array('page'=>$page,'ip'=>$ip,'userid'=>$userid, 'timestamp'=>(int) time(), 'gets'=>$get, 'posts'=>$post, 'referral'=>$ref); $m = new MongoClient(); $collection = $m->selectCollection('kuarrel', 'log'); $collection->insert($values); if($ip=='202.94.191.47'||$ip=='202.94.191.13'||$ip=='202.94.191.183'){ echo "Your address: ".$ip." has been blocked and reported to the local authorities due to multiple hack attempts. Please contact admin@harvardconnection.co if you feel this is an error."; die(); } } function lastpage($userid){ $m = new MongoClient(); $collection = $m->selectCollection('thefacebook', 'log'); $cursor = $collection->find(array('userid'=>$userid)); $cursor->sort(array('timestamp'=>-1))->limit(2); $records = iterator_to_array($cursor); return($records[1]['page']); } } ?> Quote Link to comment Share on other sites More sharing options...
ginerjm Posted March 14, 2014 Share Posted March 14, 2014 And what is the problem? You really don't know what that message is telling you? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.