我正在尝试制作一个简单的 fangate Facebook 应用程序,但我被卡住了。该页面根本不为t show - it
空白。我在互联网上找到了一个代码并实现了它(也从 github 下载了 facebook sdk) Facebook 页面 URL(http)和安全(https)是正确的。如果我链接 index.php 页面是空白的,如果我链接 prelike.php 或reveal.php 显示内容。有谁知道问题可能出在哪里?链接到 Facebook 应用程序:
https ://www.facebook.com/pages/Testna-stran/136388943218474?id=136388943218474&sk=app_744205652262463
<?php
require 'facebook.php';
$app_id = "xxxxxxxxxxxxxx";
$app_secret = "xxxxxxxxxxxxxxxxxxx";
$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"];
// The following statement does a test of $like_status and chooses which page to display to the visitor
if ($like_status) {$a = file_get_contents("reveal.php");
echo ($a);
}
else {$a = file_get_contents("prelike.php");
echo ($a);
}
?>