Help with fbaccess.php ,writes parse error

Started on the old forum in June 2012 · view the original in the archive · old links redirect here

2 replies · 496 views · started 14 years ago · 1 min read

2 participants
Busary Junior · 14 posts #1

Pls help me with fbaccess.php file it writes Parse error: syntax error, unexpected $end in /home/u419521057/public_html/fb/fbaccess.php on line 33 please u cn ***** and correct file.THANKs IN ADVANCE

something else Fellow · 2,296 posts #2

without seeing the script its impossible to answer probably a missing ; on line 32

Busary Junior · 14 posts #3

okay,dis is d script

**1. <?php 2. //Application Configurations $app_ id = "id131820383"; $ app_secret = "e96824203c7myap p"; 3. $site_url = "http:// busaryweb.tk/fb/ index.php" ; try {include_once "src/ facebook.php"; }catch (Exception $e) { error_log($e); } 4. // Create our application instance $facebook = new Facebook (array ( 'appId' => $app_ id,'secret' => $app_ secret,)); 5. // Get User ID 6. $user = $facebook-

getUser ();

  1. // We may or may not have this data based
  2. // on whether the user is logged in.
  3. // If we have a $ user id here, it means we know
  4. // the user is logged into
  5. // Facebook, but we donyt know if the access token is valid. An access
  6. // token is invalid if the user logged out of Facebook. if($ user){ // ==================== Single query method============= ===================== ====
  7. try{ //Proceed knowing you have a logged in user who's authenticated.
  8. $user_profile = $ facebook -> api('/me') ; }catch (FacebookApiExcepti on $e){error_log($e); $ user = NULL; }
  9. // ==================== Single query method ends================ ================= }
  10. if($user){// Get logout URL$ logoutUrl = $ facebook -> getLogoutUrl(); }else {// Get login URL $ loginUrl = $facebook
  • getLoginUrl(array ('scope' => 'read_ stream,publish_ stream, user_ birthday, user_ location, user_work_ history, user_ hometown, user_ photos', 'redirect_uri' => $site_url, )); }

  1. if($user){ // Proceed knowing you have a logged in user who has a valid session.
  2. //========= Batch requests over the Facebook Graph API using the PHP- SDK ========
  3. // Save your method calls into an array $queries = array (array ('method' => 'GET', 'relative_url' => '/'.$ user), array('method' => 'GET', 'relative_url' => '/'.$user.'/home? limit=50'), array ('method' => 'GET', 'relative_url' => '/'.$ user.'/friends'), array ('method' => 'GET', 'relative_url' => '/'.$ user.'/photos?limit=6') , );
  4. // POST your queries to the batch endpoint on the graph.
  5. try{$batchResponse = $facebook->api('? batch='.json_encode($ queries), 'POST'); } catch(Exception $o) {error_log($o); }
  6. //Return values are indexed in order of the original array, content is in ['body'] as a JSON
  7. //string. Decode for use as a PHP array.
  8. $user_info = json_ decode($ batchResponse[0] ['body'], TRUE); $ feed = json_decode($ batchResponse[1] ['body'],TRUE); $ friends_list = json_ decode($ batchResponse[2] ['body'], TRUE); $ photos= json_decode ($batchResponse[3] ['body'], TRUE);
  9. //========= Batch requests over the Facebook Graph API using the PHP- SDK ends =====
  10. // Update user's status using graph api
  11. if(isset($_POST ['publish'])){ try{ $ publishStream = $ facebook -> api("/$ user/feed", 'post', array('message' => 'Check out CodeLive' , 'link' =>'http:// busaryweb.tk', 'picture' => 'http://25labs.com/ images/25- labs-160-160.jpg' , 'name' => 'CodeLive', 'caption' => 'CodeLive', 'description' => 'A Technology Laboratory. Highly Recomented technology blog.' ,)); } catch (FacebookApiExcepti on $e){error_log($e); } }
  12. // Update user's status using graph api
  13. if(isset($POST ['status'])){ try{ $ statusUpdate = $ facebook -> api("/$ user/feed", 'post', array('message' => $ POST ['status'])); } catch (FacebookApiExcepti on $e){error_log($e);
  14. }
  15. }
  16. }
  17. ?>**

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close