Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (!isset($_GET['code'])) {
- header("Location: https://www.facebook.com/dialog/oauth?client_id=104053623056617&redirect_uri=my_url_is_here");
- }
- $code = $_GET['code'];
- ?>
- <html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:og="http://opengraphprotocol.org/schema/"
- xmlns:fb="http://www.facebook.com/2008/fbml">
- <head>
- <meta property="fb:app_id" content="104053623056617"/>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js" type="text/javascript"></script>
- </head>
- <body>
- <div id="fb-root"></div>
- <script>
- window.fbAsyncInit = function() {
- FB.init({
- appId : '104053623056617',
- status : true,
- cookie : true,
- xfbml : true,
- oauth : true,
- });
- FB.api('/me/accounts?access_token=<?php echo $code; ?>',
- function(response) {
- console.log(response);
- });
- };
- (function(d){
- var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
- js = d.createElement('script'); js.id = id; js.async = true;
- js.src = "//connect.facebook.net/en_US/all.js";
- d.getElementsByTagName('head')[0].appendChild(js);
- }(document));
- </script>
- <div class="fb-login-button" data-scope="email,user_checkins,manage_pages,publish_stream">Login with Facebook</div>
- <div class="result">Start</div>
- <div class="result_app_installed">Start</div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement