magic2goodil Posted January 13, 2007 Share Posted January 13, 2007 Can anyone help me figure out why I am getting this error:[code]Parse error: parse error, unexpected T_CLASS in /home/collegeb/public_html/registerAPI/cbx_facebookAPI.class.php on line 13[/code]With this code:[code]<? php/************************************************************ @CollegeBookX Facebook API * @Author: Josh Robison* @Date: Jan. 13, 2007** @Objectives: To allow the registering user to click on the * facebook icon on the register.php page and pull in their * facebook info to fill in part of the registration form.************************************************************/class cbx_facebookAPI {// ### Class Variables ###var $config; // array to hold API variablesvar $facebook; // holds Facebook object var $session; // holds Facebook sessionvar $user_info; // array to hold Facebook User Info before fixvar $user; // array to hold fixed user information // ### cbx_facebookAPI class construct ### function __construct() { // ##### INCLUDE CLASS ##### include('facebook.php'); // ### Registered API Variables ### $this->config = array(); $this->config['api_key'] = "**********"; $this->config['secret'] = "**********"; $this->config['next'] = 'index.php'; } // ### End __construct() ### // ### Make Connection and Pull User Info from Facebook ### function doConnect() { if (!empty($_REQUEST['auth_token'])) { // ##### INITIATE FACEBOOK CLASS ##### $this->facebook = new Facebook ($config['api_key'], $config['secret'], null, false, false, false); // ##### SET SESSION INFORMATION ##### $this->session = $facebook->auth_getSession ($_REQUEST['auth_token']); // ##### SET COOKIES ##### setcookie('facebook_session_key', $this->session[0]['elements'][0]['text']); setcookie('facebook_uid', $this->session[0]['elements'][1]['text'], time()+60*60*24); // ##### REDIREC TO CHAT ##### header('Location: ' . $_SERVER['PHP_SELF']); } // End IF else { // ##### CHECK FOR USER LOGGED IN ##### if (empty($_COOKIE['facebook_session_key'])) { // ##### REQUIRE LOGIN ##### header('Location: http://api.facebook.com/login.php?api_key=' . $config['api_key'] . '&next=' . $config['next']); } // End IF // ##### INITIATE CLASS ##### $this->facebook = new Facebook ($config['api_key'], $config['secret'], $_COOKIE['facebook_session_key']); // ##### PULL USER INFO ##### $this->user_info = $this->facebook->users_getInfo ($_COOKIE['facebook_uid'], 'first_name,last_name,current_location,affiliations'); $this->user = array(); $this->user['firstname'] = $this->user_info[0]['elements'][0]['elements'][0]['text']; $this->user['lastname'] = $this->user_info[0]['elements'][0]['elements'][1]['text']; // ##### CHECK FOR EXPIRED SESSION ##### if ($username == '102_Session key invalid or no longer valid') { setcookie('facebook_session_key', ''); setcookie('facebook_uid', ''); header('Location: ' . $_SERVER['PHP_SELF']); print_r($_COOKIE); } // End IF } // End Else } // ### End doConnect() ### // ### GET USER INFO FUNCTION ### function get_userinfo() { return $this->user; }} // End cbx_facebookAPI class?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/34063-unexpect-t_class-error/ Share on other sites More sharing options...
Philip Posted January 13, 2007 Share Posted January 13, 2007 You have a space between <? and php Quote Link to comment https://forums.phpfreaks.com/topic/34063-unexpect-t_class-error/#findComment-160127 Share on other sites More sharing options...
magic2goodil Posted January 13, 2007 Author Share Posted January 13, 2007 hahaha, duh *smacks forehead*Thanks man Quote Link to comment https://forums.phpfreaks.com/topic/34063-unexpect-t_class-error/#findComment-160129 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.