2011-11-14 47 views
1

由於我最近有我的服務器升級到PHP 5.3.3的東西出了問題。一切都在上週工作,現在所有這些..這是問題。5.3.3更新問題

我建立我的Facebook應用程序,但它不會承認$ _REQUEST [「CODE」]即使它出現在談到通過爲空白我的地址欄...然後我的令牌請求URL來通過這裏有一個錯誤是我的代碼...

// INCLUDE FB CONFIG 
include('admin/includes/config.inc.php'); 
include('admin/classes/dbconnect.class.php'); 

$code = $_REQUEST["code"]; 
$dialog_url = ""; 
$token_url = ""; 
$access_token = ""; 

// CHECK FOR THE REQUEST CODE - IF EMPTY REDIRECT TO THE oAUTH URL. 
if(empty($code)) { 

    // SETUP PERMISSIONS - http://developers.facebook.com/docs/authentication/permissions/ 
    $dialog_url = "http://www.facebook.com/dialog/oauth?client_id=". APP_ID ."&redirect_uri=". urlencode(APP_POST_URL)."&scope=email"; 
    echo('<script>top.location.href="' . $dialog_url . '"</script>'); 
} 

// SETUP ACCESS TOKEN URL 
$token_url = "https://graph.facebook.com/oauth/access_token?client_id=" 
. APP_ID . "&redirect_uri=" . urlencode(APP_POST_URL) 
. "&client_secret=" . APP_SECRET 
. "&code=" . $code; 

這是我不斷收到的錯誤!

Notice: Undefined index: code in /usr/wwws/users/heroadfgsm/votepoll/index.php on line 10 Warning: file_get_contents(https://graph.facebook.com/oauth/access_token?client_id=##############&redirect_uri=http%3A%2F%2Fapps.facebook.com%2Ftestapplication%2F&client_secret=###################&code=): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in /usr/wwws/users/heroadfgsm/votepoll/index.php on line 35 Notice: Undefined index: access_token in /usr/wwws/users/heroadfgsm/votepoll/index.php on line 39 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /usr/wwws/users/heroadfgsm/testfolder/index.php:10) in /usr/wwws/users/heroadfgsm/testfolder/facebook_api/facebook.php on line 37 Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown in /usr/wwws/users/heroadfgsm/testfolder/facebook_api/base_facebook.php on line 988

+0

但$代碼不爲空,因爲它加載了「的access_token」網址,對嗎? –

+0

嘗試查看本頁上的答案:http://stackoverflow.com/questions/5701588/why-is-request-empty – Derek

回答

0

解決您的通知:未定義指數:錯誤問題error_reporting(E_ALL & ~E_NOTICE);

,並檢查OpenSSL是在php.ini文件