1

我有这个代码...

require_once "facebook.php";
$app_id = "xxxxxx";
$app_secret = "xxxxx";
$facebook = new Facebook(array(
    "appId" => $app_id,
    "secret" => $app_secret,
    "cookie" => true
));

$random_file = rand();

copy('http://alylores.x10.mx/gd/clean2/pic.php', 'temp/'.$random_file.'.jpg');
$img = realpath("temp/".$random_file.".jpg");
// allow uploads
$facebook->setFileUploadSupport("http://" . $_SERVER['SERVER_NAME']);
// add a photo
$photo = $facebook->api("/".$_POST['fid']."/photos?access_token=".$_POST['foauth'],"POST",
    array(
            "source" => "@" . $img,
            "message" => "This photo came from my app."
    )
);



echo "<script type='text/javascript'>parent.iframe_callback();</script>";

unlink('temp/'.$random_file.'.jpg'); 

我正在尝试将照片从IFRAME .... facebook上传到用户的照片中,idoauth_token使用来自父窗口的发布请求传递..

当我检查时......它返回这个......

Fatal error:  Uncaught OAuthException: A user access token is required to request this resource. 
thrown in /home/alylores/public_html/gd/clean2/base_facebook.php on line 1033

但是当我检查是否 存在oauth_token确实存在....echo()oauth_token

有人可以帮我解决这个问题吗???

4

1 回答 1

0
array( "access_token" => $_POST["foauth"], "source" => "@" . $img, "message" => "This photo     came from my app." )
于 2012-04-25T01:56:06.987 回答