我刚写了一篇HTTP Post,写在用户的墙上。我的http帖子代码如下:
$url = 'https://graph.facebook.com/'.$fb_id.'/feed';
$fields = array(
'message'=>urlencode($message),
'access_token'=>urlencode($access_token)
);
$fields_string ='';
foreach($fields as $key=>$value) {
$fields_string .= $key.'='.$value.'&';
}
rtrim($fields_string,'&');
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
$post_id = curl_exec($ch);
curl_close($ch);
它的效果很好,但唯一的问题是,当帖子完成后,帖子id会回显到页面。是否有办法使帖子ID不会显示在网页上?感谢
答案 0 :(得分:0)
尝试在@
之前添加curl_exec
符号:
$post_id = @curl_exec($ch);