所有, 我使用它是Facebook提供,但这里的代码是我使用的是什么:添加数据范围变量的Facebook登录按钮
<?php
define('123', '123');
//uses the PHP SDK. Download from https://github.com/facebook/php-sdk
require 'facebook.php';
$facebook = new Facebook(array(
'appId' => '123',
'secret' => '12344556',
));
$userId = $facebook->getUser();
?>
<html>
<body>
<?php if ($userId) {
//$userInfo = $facebook->api('/' + $userId);
$userInfo = $facebook->api('/me');
print_r($userInfo);
?>
Your email address is: <?= $userInfo['email'] ?>
<?php } else { ?>
<div id="fb-root"></div>
<fb:login-button></fb:login-button>
<?php } ?>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '<?= 123?>',
status : true,
cookie : true,
xfbml : true,
oauth : true,
});
FB.Event.subscribe('auth.login', function(response) {
window.location.reload();
});
};
(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>
</body>
</html>
如果我需要某人的电子邮件地址时,他们登录我想添加该数据范围变量,因此如果这是他们第一次登录,它会提示他们向我提供该权限。我在哪里添加到上面的代码?我必须将它放在登录按钮中吗?
请帮忙!
谢谢!
使用例如,如果不使用FB什么:登录按钮这是唯一为他们的小按钮?他们的大按钮是一个div – markmnl 2016-12-15 03:45:59