jarv Posted February 9, 2008 Share Posted February 9, 2008 ok so i am working my way through the facebook app tutorial from .net magazine issue 172 (feb 2008) I have all the files from the CD and the SQL file which i have set up the mySQL database I have added my secret code and app API code to my config.php file, I am not sure what to do next?! when i go to the index.php file i get the following error: PHP Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in e:\Domains\mypubspace.com\wwwroot\fb\client\facebook.php on line 37 Quote Link to comment Share on other sites More sharing options...
wsantos Posted February 9, 2008 Share Posted February 9, 2008 This tells you what to look for. PHP Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in e:\Domains\mypubspace.com\wwwroot\fb\client\facebook.php on line 37 Parse Error ... you are lacking a close bracket Quote Link to comment Share on other sites More sharing options...
jarv Posted February 9, 2008 Author Share Posted February 9, 2008 so i changed all the publics to vars now i get an error on line 90: PHP Parse error: parse error, unexpected T_RETURN function do_get_session($auth_token) { try { return $this->api_client->auth_getSession($auth_token); } catch (FacebookRestClientException $e) // API_EC_PARAM means we don't have a logged in user, otherwise who // knows what it means, so just throw it. if ($e->getCode() != FacebookAPIErrorCodes::API_EC_PARAM) { throw $e; } } } Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted February 9, 2008 Share Posted February 9, 2008 Edit: For the same reason the "public" keyword caused the previous error (it is php5 specific) the try/throw exception in that function is php5 specific. You are apparently using php4. Since the end of life of php4 has already gone past, you should upgrade to php5. Doing so will also let the code you are trying work as expected. Parse errors are usually detected and reported on the line(s) after the actual syntax error in your code, because php could not figure out what you were actually doing due to a missing syntax element. If you cannot determine what is wrong with the syntax in your code, post at least 5 lines before the line with the error through the line that the error refers to. Also let us know which php version you are using (some php5 OOP syntax will trigger syntax errors in php4 that are similar to the one you posted.) 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.