Advertisement
Guest User

Untitled

a guest
Aug 7th, 2011
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php
  2. include "include/facebook.php";
  3. $config = array(
  4. 'appId' => '195821290433646',
  5. 'secret' => 'xxxxxxxxxxxxxx',
  6. );
  7. $facebook = new Facebook($config);
  8. $user = $facebook->getUser();
  9. if ($user) {
  10. // proceed knowing you have a logged in user who's authenticated
  11. } else {
  12. $loginUrl = $facebook->getLoginUrl(array('canvas' => 1,
  13. 'fbconnect' => 0,
  14. 'req_perms' => 'publish_stream'));
  15. echo "<script type=\"text/javascript\">
  16. top.location.href = '$loginUrl'
  17. </script>";
  18. }
  19. ?>
  20. <!doctype html>
  21. <html xmlns:fb="http://www.facebook.com/2008/fbml">
  22. <head>
  23.  
  24. </head>
  25. <body>
  26. <h2>Page 1</h2>
  27. <a href="page2.php">Page 2</a>
  28. </body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement