title: the user hasn't authorized the application to perform this action(#200)
body: <p>Hi I need to post message on facebook fan page </p>
  
  <p>this is my code
   When I run this code I have following error 
  (#200) The user hasn't authorized the application to perform this action
  if access_token token problem ?
  how can i create access_token</p>
  
  <pre><code>&lt;?php
      require 'facebook-php-sdk-master//src/facebook.php';
  
      $appId = '1617691071796143';
      $secret = 'd84420ccfe2fa7eecac50ca96936bb21';
      $returnurl = 'lankabird.com';
      $permissions = 'manage_pages, publish_stream, offline_access,read_stream';
  
      $fb = new Facebook(array('appId'=&gt;$appId, 'secret'=&gt;$secret));
      $fbuser = $fb-&gt;getUser();
  
      if($fbuser){
  
          $page_id = "1596941017191630";
          $page_access_token = "";
          //$page_access_token = "1617691071796143|d84420ccfe2fa7eecac50ca96936bb21";
          $result =  $fb-&gt;api("/me/accounts");
  
          // loop trough all your pages and find the right one
          if( !empty($result['data']) )
          {
             foreach($result["data"] as $page) 
             {
               if($page["id"] == $page_id)
               {
                 $page_access_token = $page["access_token"];
                 break;
               }
             }
          }
          else
          {
            echo "AN ERROR OCCURED: could not get the access_token. Please verify the page ID ".$page_id." exists.";
          }
  
          $fb-&gt;setAccessToken($page_access_token);
  
          // Now try to post on page's wall
          try{
              $message = array(
                  'message' =&gt; "YOUR MESSAGE",
              );
  
              $result = $fb-&gt;api('/'.$page_id.'/feed','POST',$message);
              if($result)
              {
                  echo 'Successfully posted to Facebook Wall...';
              }
          }catch(FacebookApiException $e){
              echo $e-&gt;getMessage();
          }
  
      }else{
          $fbloginurl = $fb-&gt;getLoginUrl(array('redirect-uri'=&gt;$returnurl, 'scope'=&gt;$permissions));
          echo '&lt;a href="'.$fbloginurl.'"&gt;Login with Facebook&lt;/a&gt;';
      }
  ?&gt;
  </code></pre>