title: Post message on Facebook with curl
body: <p>I want to be able for my web site to post a message on the fan page of the website.</p>
  
  <p>So I use this code I found:</p>
  
  <pre><code>&lt;?php
  require_once("assets/facebook.php");
  
  $facebook = new Facebook(array(
  'appId'  =&gt; '471898006354908', // Fake
  'secret' =&gt; 'd2f7fb2dbc0ab7f42bc1c4337ab041b1', // Fake
  'cookie' =&gt; true
  ));
  
  $access_token = $facebook-&gt;getAccessToken();
  echo $access_token;
  
  $msg = "testmsg";
  $title = "testt";
  $uri = "http://somesite.com";
  $desc = "testd";
  $pic = "http://static.adzerk.net/Advertisers/d18eea9d28f3490b8dcbfa9e38f8336e.jpg";
  $attachment =  array(
      'access_token' =&gt; $access_token,
      'message' =&gt; $msg,
      'name' =&gt; $title,
      'link' =&gt; $uri,
      'description' =&gt; $desc,
      'picture'=&gt;$pic,
      'actions' =&gt; json_encode(array('name' =&gt; $action_name,'link' =&gt; $action_link))
  );
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/me/feed');
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  //to suppress the curl output
  $result = curl_exec($ch);
  curl_close ($ch);
  
  ?&gt;
  </code></pre>
  
  <p>Each time I execute the page it echoes me something like this:</p>
  
  <pre><code>471898006354908|d2f7fb2dbc0ab7f42bc1c4337ab041b1
  </code></pre>
  
  <p>But it don't post anything on my fan page ?</p>
  
  <p>Any help please ?</p>