Possible Duplicate:
Facebook Graph Api - Posting to Fan Page as an Admin
I've written the code below:
$pageId = 'xxx';
$appId = 'xxx';
$secret = 'xxx';
$facebook = new Facebook(array(
'appId' => $appId,
'secret' => $secret,
'cookie' => false
));
$access_token = $facebook->getAccessToken();
$facebook->api("/{$pageId}/feed", "post", array(
'message' => "First message",
'name' => "Name for first",
'access_token' => $access_token
));
But getting the following exception: (#200) The user hasn't authorized the application to perform this action