Facebook graph api 无法获取Facebook Cookie并执行代码
因为我是facebook graph API的新手,但我知道一些基本知识。现在我需要你们的帮助,告诉我如何使用read_stream阅读用户墙上的帖子和其他任何用户墙上的帖子。但是我不知道怎么打电话。我尝试了一些方法,但我能读懂JU的名字和基本信息。我需要帮助阅读物品。请帮帮我Facebook graph api 无法获取Facebook Cookie并执行代码,facebook-graph-api,facebook,Facebook Graph Api,Facebook,因为我是facebook graph API的新手,但我知道一些基本知识。现在我需要你们的帮助,告诉我如何使用read_stream阅读用户墙上的帖子和其他任何用户墙上的帖子。但是我不知道怎么打电话。我尝试了一些方法,但我能读懂JU的名字和基本信息。我需要帮助阅读物品。请帮帮我 <?php header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');?> <?p
<?php header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND
CNT"');?>
<?php
define('FACEBOOK_APP_ID', 'xxxxx');
define('FACEBOOK_SECRET', 'xxxxxxxxx');
function get_facebook_cookie($app_id, $application_secret) {
$args = array();
print_r($_COOKIE);
parse_str(trim($_COOKIE['fbs_' . $app_id], '\\"'), $args);
ksort($args);
$payload = '';
foreach ($args as $key => $value) {
if ($key != 'sig') {
$payload .= $key . '=' . $value;
}
}
if (md5($payload . $application_secret) != $args['sig']) {
return null;
}
return $args;
}
$cookie = get_facebook_cookie($app_id, $application_secret);
echo 'The ID of the current user is ' . $cookie['uid'];
?>
<html>
<body>
<?php if ($cookie) { ?>
Your user ID is <?= $cookie['uid'] ?>
<?php } else { ?>
<fb:login-button>Install Example App</fb:login-button>
<?php } ?>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({appId: 'xxxxxx', xfbml: true,cookie:true});
FB.Event.subscribe('auth.login', function(response) {
// Reload the application in the logged-in state
window.top.location = 'http://apps.facebook.com/fbvantivirus';
});
</script>
<div style="display:none">
</body>
</html>
欢迎来到饼干地狱。你需要一个P3P契约政策。 在iframe中,第一行:
<?php header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');?>