在过去的几天里,我一直在构建一个新的 Facebook 应用程序,该应用程序允许用户将 PHP CMS 添加到他们的粉丝页面,让他们无需任何设计或编程知识即可构建一个完整的“迷你网站”。
但是,当我尝试获取安装应用程序的当前页面 ID 时,我什么也得不到。
我同时使用 HTTP 和 HTTPS,但我从其中任何一个都得不到任何信息。
我试图提取数据的代码是:
require "src/facebook.php";
$app_id = “MY APP ID”;
$app_secret = “MY APP SECRET”;
$facebook = new Facebook(array(‘appId’ => $app_id,
‘secret’ => $app_secret,
‘cookie’ => true));
$signed_request = $facebook->getSignedRequest();
$page_id = $signed_request["page"]["id"];
$page_admin = $signed_request["page"]["admin"];
$like_status = $signed_request["page"]["liked"];
$country = $signed_request["user"]["country"];
$locale = $signed_request["user"]["locale"];
echo "<br>". $pageid;
echo "<br>". $page_admin;
echo "<br>". $like_status;
我有这些错误信息:
Notice: Use of undefined constant “247517918644221” - assumed '“247517918644221”' in /home/hazvuv/hazvuvp.com/why/index.php on line 6
Notice: Use of undefined constant “d7750be2ef0934bea4e2e8fe65a42a2a” - assumed '“d7750be2ef0934bea4e2e8fe65a42a2a”' in /home/hazvuv/hazvuvp.com/why/index.php on line 7
Notice: Use of undefined constant ‘appId’ - assumed '‘appId’' in /home/hazvuv/hazvuvp.com/why/index.php on line 9
Notice: Use of undefined constant ‘secret’ - assumed '‘secret’' in /home/hazvuv/hazvuvp.com/why/index.php on line 10
Notice: Use of undefined constant ‘cookie’ - assumed '‘cookie’' in /home/hazvuv/hazvuvp.com/why/index.php on line 11
Notice: Undefined index: appId in /home/hazvuv/hazvuvp.com/why/src/base_facebook.php on line 213
Notice: Undefined index: secret in /home/hazvuv/hazvuvp.com/why/src/base_facebook.php on line 214
Notice: Undefined variable: pageid in /home/hazvuv/hazvuvp.com/why/index.php on line 22
我究竟做错了什么?