无法找到www.facebook.com100003773239192%26photoid%3D上的服务器,因为DNS查找失败

时间:2012-04-30 09:51:34

标签: php facebook facebook-graph-api web-applications facebook-php-sdk

//Create an album
$album_details = array(
        'message'=> 'How will you die?',
        'name'=> 'How will you die?'
);
$create_album = $facebook->api('/me/albums', 'post', $album_details);


//Get album ID of the album you've just created
$album_uid = $create_album['id'];

//Upload a photo to album of ID...

$file='img/'.$fbid.'.jpg'; //Example image file

$photo_details = array( 'message'=> 'Find...51', 'image' => '@'.realpath($file));

 if ($session) {
    // We have a valid FB session, so we can use 'me'
    $upload_photo = $facebook->api('/me/photos', 'post', $photo_details);
} elseif( isset($_SESSION['user_id']) ) {
    $upload_photo = $facebook->api("/{$_SESSION['user_id']}/photos", 'post', $photo_details);
}

$upphoto = $upload_photo['id'];


ImageDestroy( $canvas );

header("Location: http://www.facebook.com".$fbid."&photoid=".$upphoto."")

我创建了一个上传照片用户墙的Facebook应用程序。

但反复我得到了上述错误。我想在上面的代码中某处遗漏了'/'但我不知道在哪里放'/'。如果发现任何其他错误,请帮助我完成并运行此代码。

谢谢!

1 个答案:

答案 0 :(得分:0)

更改

header("Location: http://www.facebook.com".$fbid."&photoid=".$upphoto."")

header("Location: http://www.facebook.com/".$fbid."&photoid=".$upphoto);