2011-11-14 45 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文件