如何将facebook响应对象传递给php对象?

时间:2013-04-17 14:45:53

标签: php javascript facebook-apps

当用户成功登录facebook时,javascript中有一个响应对象。如何使用post或其他方法将此对象传递给PHP?

window.fbAsyncInit = function() {
            FB.init({
                appId: '12345788', // App ID
                channelUrl: /channel.html', // Channel File
                status: true, // check login status
                cookie: true, // enable cookies to allow the server to access the session
                xfbml: true  // parse XFBML
            });

            // Additional init code here
            FB.getLoginStatus(function(response) {
                if (response.status === 'connected') {
                    // connected
                    var uid = response.authResponse.userID;
                    var accessToken = response.authResponse.accessToken;

                } else if (response.status === 'not_authorized') {
                    // not_authorized


                } else {
                    // not_logged_in

                }

            });

0 个答案:

没有答案