Guest User

Untitled

a guest
Jan 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. require 'facebook/src/facebook.php';
  2. $facebook = new Facebook(array(
  3. 'appId' => 'xxxxxxx',
  4. 'secret' => 'xxxxxxxx',
  5. 'cookie' => true
  6. ));
  7. $user = $facebook->getUser();
  8.  
  9. if ($user) {
  10. try {
  11. // Proceed knowing you have a logged in user who's authenticated.
  12. $user_profile = $facebook->api('/me');
  13. } catch (FacebookApiException $e) {
  14. //echo '<pre>'.htmlspecialchars(print_r($e, true)).'</pre>';
  15. $user = null;
  16. }
  17.  
  18. }
  19.  
  20. var_dump($user_profile);exit;
Add Comment
Please, Sign In to add comment