Jump to content

facebook app help required


jarv

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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;
      }
    }
  }

 

Link to comment
Share on other sites

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.)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.