【发布时间】:2014-03-19 17:31:42
【问题描述】:
我已将我的 facebook 应用程序添加到一个页面,但访问它时会显示一个带有悲伤表情的空白页面。 知道是什么原因造成的吗? 我已粘贴在我正在使用的索引和配置文件下方。
我的链接中的索引文件是:
<?php
include("config.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
body {
width:520px;
margin:0; padding:0; border:0;
}
</style>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
</head>
<body>
<div id="container">
<p>Pagina de dulciuri a lui Alexis</p>
<a href="formular.php">Du-te la formular</a>
</div>
</body>
</html>
config.php:
<?php
require './src/facebook.php';
$fbPermissions = 'publish_stream,manage_pages,photo_upload';
$config = array(
'appId' => 'ID',
'secret' => 'secret',
'fileUpload' => true, // optional
'allowSignedRequest' => true, // optional, but should be set to false for non-canvas apps
'cookie' => true,
);
$facebook = new Facebook($config);
$session = $facebook->getUser();
if ($session) {
} else {
echo "Please login and come back!";
}
?>
谢谢
【问题讨论】:
标签: php facebook facebook-apps