douzuan5365 2011-09-28 01:59
浏览 11

在照片中标记朋友

This is my code. It does not show any errors but only the first 2 friends are tagged!

for ($i=0;$i<count($friendsID);$i++)
{
 $post_url = "https://graph.facebook.com/".$upload_photo['id']."/tags/".$friendsID[$i]."?access_token=".$token."&x=80&y=".$y."&method=POST";
 $response = file_get_contents($post_url);
 $post_url = urlencode($post_url);
 $response = file_get_contents($post_url);
 $y = $y + 53;
}

I'm not receiving any error, but the code just does not tag all the people supposed to be tagged !

  • 写回答

1条回答 默认 最新

  • doufeng9567 2011-09-28 02:11
    关注

    According to the "Publishing" section in the Facebook Developer API docs, writes to the graph must be POST'ed. Your request as written uses GET. See this question for how to convert your request to a POST.

    As an aside, note that urlencode should only be applied to the parameters of a URL, not the entire URL. Otherwise the colons & slashes in the base part of your URL will get encoded as well.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大