title: Facebook auto post on wall after like
body: <p>So basically i am building a script for a client which is used as an iframe in his page. What it should do is when a user likes his page then he can see the contents and the "app" should auto post something to his wall (sounds like spam but im not sure if there is a problem with that). so i got the first bit working but for the love of god i cant make the second part.. here's my code</p>
  
  <pre><code>&lt;? require 'facebook.php';
  $app_id = "my_appid";
  $app_secret = "my_secret";
  $facebook = new Facebook(array(
  'appId' =&gt; $app_id,
  'secret' =&gt; $app_secret,
  'cookie' =&gt; true
  ));
  $signed_request = $facebook-&gt;getSignedRequest();
  function parsePageSignedRequest() {
      if (isset($_REQUEST['signed_request'])) {
        $encoded_sig = null;
        $payload = null;
        list($encoded_sig, $payload) = explode('.', $_REQUEST['signed_request'], 2);
        $sig = base64_decode(strtr($encoded_sig, '-_', '+/'));
        $data = json_decode(base64_decode(strtr($payload, '-_', '+/'), true));
        return $data;
      }
      return false;
    }
    if($signed_request = parsePageSignedRequest()) {
      if($signed_request-&gt;page-&gt;liked) {
        echo "This content is for Fans only!";    
      } else {
        echo "Please click on the Like button to view this tab!";
      }
    }
  
  ?&gt;
  </code></pre>
  
  <p>i tried adding this on the "logged state"</p>
  
  <pre><code>$result = $facebook-&gt;api( '/me/feed/','post',
          array('access_token' =&gt; $app_secret,
                'message' =&gt; 'Playing around with FB Graph..')
      );
  </code></pre>
  
  <p>with no luck as i get an error. please let me know if you can help. thanx</p>