이 방법은 효과가 없습니다. 당신은 자바 스크립트를 사용하여 로그인과 인증을 처리하는 것이 더 낫다.
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR_APP_ID',
session : { VALID_SESSION_DATA }, // don't refetch the session if PHP already has it
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
function login() {
FB.login(
function(response) {
if (response.session) {
if (response.perms) {
// user is logged in, and granted any permissions
} else {
// user is logged in, but did not grant any permissions
}
} else {
// user is not logged in
}
}, {perms:'publish_stream'}
);
}
</script>
사용자에게 권한을 부여하는 방법에 대한 코드 예를 붙여 넣을 수 있습니까? – jBit
예, 여기 : $ logoutUrl = $ facebook -> getLoginUrl(); \t echo (""); – user310707
어떤 PHP SDK 버전을 사용하고 있습니까? – jBit