title: Posting To Facebook Fan Page As Admin Using PHP
body: <p>I am using php sdk 3.0 and i want to publish streams on my fan page as admin. i use some code like below and all work fun but the streaming post are not posted  as an admin user but as fan user (the )</p>
  
  <p>The login request</p>
  
  <pre><code>$fb = new Facebook( array(   'appId'  =&gt; $pluginParams-&gt;get('ApplicationKey'),
    'secret' =&gt; $pluginParams-&gt;get('Secret'),
    'cookie' =&gt; true
  )) ;
  .......
  $loginUrl = $fb-&gt;getLoginUrl(array('scope' =&gt; 'manage_pages,offline_access,publish_stream, read_stream'));
  </code></pre>
  
  <p>The code part to send stream's</p>
  
  <pre><code>$body['id'] = $pluginParams-&gt;get('YourFanpageID');
  $body['message']=$message;
  $body['picture']=$image;
  $body['caption']=$item-&gt;title;
  ....
  $AccessToken=   $this-&gt;get_page_access_token($pluginParams-&gt;get('YourFanpageID'), $pluginParams-&gt;get('AccessToken'), $pluginParams-&gt;def('UserID',$me['id']));
  ......
  
  $body = http_build_query($body);
  $body = urldecode($body);
  
  $request = array(
    'method' =&gt; 'POST',
    'relative_url' =&gt; 'feed',
    'body' =&gt; $body
  );
  
  $batch[] = $request;
  
  $params = array(
    'access_token' =&gt; $AccessToken,  
    'batch' =&gt; json_encode($batch)
  );
  
  $result=$fb-&gt;api('/', 'POST', $params);
  </code></pre>
  
  <p>function to get access token page</p>
  
  <pre><code>function get_page_access_token($page_id, $access_token, $user_id) {
      $data = file_get_contents('https://graph.beta.facebook.com/'.$user_id.'/accounts?access_token='.$access_token);
      $pages = json_decode($data,true);
      foreach($pages['data'] as $page) {
        if($page['id'] == $page_id) {
          return $page['access_token']; 
        }   
     }
  }
  </code></pre>
  
  <p>Can you tell pls if there are a code to add to tell the page that this is an admin post? </p>
  
  <p>Posting To Facebook Fan Page As Admin Using PHP?</p>