Facebook SDK OOP Error

abiccacealf

New Member
I converted a simple login / register script (with facebook connect) to oop.But now when I call getUser() i get an error:\[code\] Fatal error: Call to a member function getUser() on a non-object \[/code\]Anyone know how I can fix it? Thanks.ps. the facebook sdk is included.\[code\] private $facebook; private $db; public function __construct($db_user, $db_password, $db_name, $db_host, $app_id, $secret) { if (empty($_SESSION)) { $this->facebook = new Facebook(array( 'appId' => $app_id, 'secret' => $secret, 'cookie' => true )); $this->db = new ezSQL_mysql($db_user, $db_password, $db_name, $db_host); } else { $this->Redirect('index.php'); } } public function Login() { $session = $this->facebook->getUser(); }\[/code\]
 
Back
Top