0
正如標題所說,我有一個奇怪的問題。當我點擊我的索引頁上的另一個鏈接時,它會重定向到索引。我在兩頁上都寫了相同的權限代碼。Facebook權限重定向索引當點擊另一頁
這裏是我的代碼:
<?php
$code = $_REQUEST["code"];
if(empty($code)) {
$dialog_url = "http://www.facebook.com/dialog/oauth?client_id="
. $app_id . "&redirect_uri=" . urlencode($my_url) . "&scope=email,publish_stream,offline_access";
echo("<script> top.location.href='" . $dialog_url . "'</script>");
}
$token_url = "https://graph.facebook.com/oauth/access_token?client_id="
. $app_id . "&redirect_uri=" . urlencode($my_url) . "&client_secret="
. $app_secret . "&code=" . $code . "&scope=email,publish_stream,offline_access";
$access_token = file_get_contents($token_url);
$graph_url = "https://graph.facebook.com/me?" . $access_token;
$user = json_decode(file_get_contents($graph_url));
?>
我寫這篇文章的代碼,我已經在我的索引鏈接的所有網頁。
是我的代碼錯了,有服務器問題還是別的?