0

嗨,我正在使用此代码在我的粉丝页面上发布注释,它有效,问题是日记页面不显示图像,而只有文字,为什么?

<?php
$access_token='MY ACCES TOKEN FAN PAGE';
$attachment = array(
'access_token' => $access_token,
'message' => 'MESSAGE <img src="IMAGE_ADDRESS" alt="TEST IMAGE" /> ',
'subject' => 'test test test'
);

// set the target url
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/id_fanpage/notes?');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); //to suppress the curl output

$result= curl_exec($ch);
curl_close ($ch);
4

1 回答 1

0

你是怎么上传图片的?

似乎notes'message字段接受 HTML 标记,因此具有以下内容应该可以工作:

<img src='http://domain.com/myImage.jpg' />
于 2013-01-12T21:03:19.677 回答