请帮忙。将照片上传到相册的代码。改代码后不起作用,报错 {"error": {"message": "(# 240) The references target_id an inactive user", "type": "OAuthException", "code": 240}} 我试过我一无所有,只有思考。我在这里寻找专业和支持。谢谢你的每一个答案。
$app_id = "xxxxx";
$app_secret = "xxxxxxx";
$post_login_url = "http://redirectpage";
$album_id = "1";
$photo_url = "http://myimg.com";
$photo_caption = "xxxxxxxxx";
$code = $_REQUEST["code"];
if (!$code){
$dialog_url= "http://www.facebook.com/dialog/oauth?"`enter code here`
. "client_id=" . $app_id
. "&redirect_uri=" . urlencode( $post_login_url)
. "&scope=publish_stream";
echo("<script>top.location.href='" . $dialog_url
. "'</script>");
} else {
$token_url="https://graph.facebook.com/oauth/access_token?"
. "client_id=" . $app_id
. "&client_secret=" . $app_secret
. "&redirect_uri=" . urlencode( $post_login_url)
. "&code=" . $code;
$response = file_get_contents($token_url);
$params = null;
parse_str($response, $params);
$access_token = $params['access_token'];
$graph_url= "https://graph.facebook.com/"
. $album_id . "/photos?"
. "url=" . urlencode($photo_url)
. "&message=" . urlencode($photo_caption)
. "&method=POST"
. "&access_token=" .$access_token;
echo '<html><body>';
echo file_get_contents($graph_url);
echo '</body></html>';
}