如何从facebook url获取内容并提取facebook用户ID和访问令牌。我使用了CURL,它返回了空的内容。
$url = 'https://graph.facebook.com/oauth/access_token?client_id='.$fbconfig['appid'].'&redirect_uri='.$returnurl.'&client_secret='.$fbconfig['secret'].'&code='.$_REQUEST['code'];
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_VERBOSE => true
));
$result = curl_exec($ch);
curl_close($ch);
$iResult=AlowUserAccess();
$FBUserId = explode('|', $iResult);
$FBUserId = explode('|', $FBUserId['1']);
$FBUserId = explode('-', $FBUserId['0']);
$iUserId = $FBUserId['1'];
$iUserId = $iResult;
$sAccessToken = explode('access_token=', $iResult);
答案 0 :(得分:0)