在尝试使用PHP作为脚本语言在Facebook上发帖时,脚本在成功验证到facebook后停止。使用的代码如下所示。请帮我解决此问题。
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
$fbcheck= $facebook->getUser();
if(is_null($fbcheck) or !$fbcheck or $fbcheck==0)
{
header("Location:{$facebook->getLoginUrl(array('scope' => 'user_status,publish_stream,user_photos,photo_upload'))}");
}
$attachment = array(
'message' => 'Hello friends , try this job :)',
'name' => "Jobslanda - The perfect job information system. ",
'caption' => "My Caption",
'link' => 'google.com',
'description' => 'Jobslanda is one of the perfect job sharing system.',
//'picture' => $urlParser->fbpostpic($input['ik']),
'actions' => array(array(
'name' => 'Get Search',
'link' => 'http://www.google.com'
))
);
$result = $facebook->api(
'/me/feed/',
'post',
$attachment
);
答案 0 :(得分:1)
的print_r($结果);检查它是否返回带有数字的id。