警告: file_get_contents( http://graph.facebook.com/ ) [function.file-get-contents]: ストリームを開くことができませんでした: HTTP リクエストが失敗しました! /hermes/fb_youtube_downloader/redirect_url.php の 5 行目の HTTP/1.0 400 Bad Request
警告: ヘッダー情報を変更できません - 8 行目の /hermes/fb_youtube_downloader/redirect_url.php の (/hermes/bosoraweb069/b288/fb_youtube_downloader/redirect_url.php:5 で出力が開始された) ヘッダーによって既に送信されています。 phpページ
<?php session_start();
ob_start();
require("facebook.php");
require("config.php");
$facebook = new Facebook(array(
'appId' => $fbconfig['appid'],
'secret' => $fbconfig['secret'],
'cookie' => true,
'oAuth' => true
));
print_r($_REQUEST['arg']);
$access = $facebook -> getAccessToken();
$signedRequest = $facebook ->getSignedRequest();
/*echo "<pre>";
print_r($signedRequest);
echo "</pre>";
exit;*/
if($signedRequest['page']['id'] != ""){
$_SESSION["fb_page_id"] = $signedRequest['page']['id'];
$_SESSION['fb_page_admin'] = $signedRequest['page']['admin'];
}
$loginUrl = $facebook->getLoginUrl(
array(
'scope' => 'publish_stream,manage_pages',
'redirect_uri' => $fbconfig['redirect_uri'] . "&pageiid=".$_SESSION['fb_page_id']
)
);
//$logoutUrl = $facebook->getLogoutUrl();
$user = $facebook->getUser(); # User id of the current Facebook user
if (!$user) {
//$_SESSION['installed'] = 1;
echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>"; # Authentication part
exit;
}
?>
私のリダイレクト URL ページ
<?php
if(isset($_REQUEST['page']) && $_REQUEST['page'] == "facebookPage"){
//include("config.php");
session_start();
$page_details = file_get_contents("http://graph.facebook.com/" . $_REQUEST["pageiid"]);
$page_arr = json_decode($page_details);
$pg_url = $page_arr->link."?sk=app_".$_SESSION['fb_app_id'];
header("Location: " . $pg_url);
exit;
}
?>