尝试使用 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
);