我在文档中使用 Facebook 应用程序画布代码,并且在我点击“允许”后它不断重定向。不知道出了什么问题。请检查它是一个错误还是只是我。它来自 http://developers.facebook.com/docs/appsonfacebook/tutorial/
<?php
$app_id = ""; //Added my app id
$canvas_page = ""; //Added my canvas page
$auth_url = "http://www.facebook.com/dialog/oauth?client_id="
. $app_id . "&redirect_uri=" . urlencode($canvas_page);
$signed_request = $_REQUEST["signed_request"];
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
if (empty($data["user_id"])) {
echo("<script> top.location.href='" . $auth_url . "'</script>");
} else {
echo ("Welcome User: " . $data["user_id"]);
}
?>