title: Facebook Graph Api - Posting to Fan Page as an Admin
body: <p>I've setup a script which allows users to post messages to a fan page on Facebook. It all works but there's one small issue.</p>
  
  <p><strong>The Problem:</strong></p>
  
  <p>When the post is added to the page feed it displays the posting user's personal account.
  I would prefer it to show the account of the page (like when you're admin of the page it says it came from that page). The account I'm posting with have admin rights to the page, but it still shows as a personal post.</p>
  
  <p><strong>HTTP POST</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>$url = "https://graph.facebook.com/PAGE_ID/feed";
  $fields = array (
      'message' =&gt; urlencode('Hello World'),
      'access_token' =&gt; urlencode($access_token)
  );
  
  $fields_string = "";
  foreach ($fields as $key =&gt; $value):
      $fields_string .= $key . '=' . $value . '&amp;';
  endforeach;
  rtrim($fields_string, '&amp;');
  
  $ch = curl_init();
  
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_POST, count($fields));
  curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
  
  $result = curl_exec($ch);
  curl_close($ch);
  </code></pre>