SHARE
TWEET

Untitled

a guest Jul 18th, 2013 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='UTF-8'>
  5. <title>Test integracji logowania</title>
  6. </head>
  7. <body>
  8.  
  9. <?php
  10. require_once('./facebook-php-sdk-master/src/facebook.php');
  11.  
  12. $config['appId'] = '190XXXXXX';
  13. $config['secret'] = '54eb9eeXXXXXXXXXXXXXXXXf6423bb';
  14.  
  15. $fb = new Facebook($config);
  16.  
  17. if ($fb -> getUser())
  18. {
  19.         $user = $fb -> api('me');
  20.         $user_name = $user['name'];
  21.        
  22.         echo '<p>Jesteś zalogowany jako '.$user_name.'</p>';
  23.        
  24.         $logout_url = $fb -> getLogoutUrl();
  25.        
  26.         echo '<p><a href=\''.$logout_url.'\'>Wyloguj przez Facebook-a<a></p>';
  27. }
  28. else
  29. {
  30.         $params['scope'] = 'email, read_stream, friends_likes';
  31.         $params['redirect_url'] = 'http://dom.olo-web.eu/fb/fb.php';
  32.        
  33.         $login_url = $fb -> getLoginUrl($params);
  34.        
  35.         echo '<p><a href=\''.$login_url.'\'>Zaloguj się przez Facebook-a</a></p>';
  36. }
  37. ?>
  38.  
  39. </body>
  40. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top