Advertisement
Guest User

Untitled

a guest
Feb 7th, 2012
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. <?php
  2. if (!isset($_GET['code'])) {
  3. header("Location: https://www.facebook.com/dialog/oauth?client_id=104053623056617&redirect_uri=my_url_is_here");
  4. }
  5. $code = $_GET['code'];
  6. ?>
  7. <html xmlns="http://www.w3.org/1999/xhtml"
  8. xmlns:og="http://opengraphprotocol.org/schema/"
  9. xmlns:fb="http://www.facebook.com/2008/fbml">
  10. <head>
  11. <meta property="fb:app_id" content="104053623056617"/>
  12. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js" type="text/javascript"></script>
  13.  
  14. </head>
  15. <body>
  16. <div id="fb-root"></div>
  17. <script>
  18. window.fbAsyncInit = function() {
  19. FB.init({
  20. appId : '104053623056617',
  21. status : true,
  22. cookie : true,
  23. xfbml : true,
  24. oauth : true,
  25. });
  26. FB.api('/me/accounts?access_token=<?php echo $code; ?>',
  27. function(response) {
  28. console.log(response);
  29. });
  30. };
  31. (function(d){
  32. var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
  33. js = d.createElement('script'); js.id = id; js.async = true;
  34. js.src = "//connect.facebook.net/en_US/all.js";
  35. d.getElementsByTagName('head')[0].appendChild(js);
  36. }(document));
  37. </script>
  38. <div class="fb-login-button" data-scope="email,user_checkins,manage_pages,publish_stream">Login with Facebook</div>
  39.  
  40. <div class="result">Start</div>
  41. <div class="result_app_installed">Start</div>
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement