Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在php中将图像发布到facebook事件?_Php_Facebook_Fbml - Fatal编程技术网

如何在php中将图像发布到facebook事件?

如何在php中将图像发布到facebook事件?,php,facebook,fbml,Php,Facebook,Fbml,这是我的密码 $event_info['name'] = $name2; $event_info['category'] = 1; $event_info['privacy_type'] = 'OPEN'; $event_info['subcategory'] = 1; $event_info['description'] = $description_new; //description for event //$event_info['host'] = $desc; //descriptio

这是我的密码

$event_info['name'] = $name2;
$event_info['category'] = 1;
$event_info['privacy_type'] = 'OPEN';
$event_info['subcategory'] = 1;
$event_info['description'] = $description_new; //description for event
//$event_info['host'] = $desc; //description for event
//$event_info['host'] = 'You';
$event_info['location'] = $location;
$event_info['city'] = $city; //Must be a valid city name

$event_info['start_time'] = $newTime; //Converts time to UTC
$event_info['picture'] = "@http://static.eventful.com/images/small/I0-001/003/184/085-4.jpeg";
一切都是后,除了图像,我想创建事件与事件图像


如何做到这一点?

您需要的是以下几点:

$fname="/tmp/foo.jpg";
$attachment =  array(
        'access_token' => $facebook->getAccessToken(),
        'name' => '',
        'description' => '',
        'start_time' => '',
        'link' => '',
        'source'=> '@'.$fname
        /*...*/
);

/*Send the data*/
$result = $facebook->api('/me/events', 'POST', $attachment);