title: how to post on facebook using htc sense api
body: <p>I am using Facebook SDK with HTC Sense Token,so i want to do that requests with user auth just with the token doing like this with the token i want to send requests with use a app(using the htc sense token) i had an appid but i had no secret code to post on facebook how to get the app htc sense app secret code to post on my wall,page etc</p>
  
  <pre><code>    &lt;?php
      session_start();
  
      require_once 'facebook-php-sdk/autoload.php';
      use Facebook\FacebookSession;
      use Facebook\FacebookRequest;
      use Facebook\GraphUser;
      use Facebook\FacebookRequestException;
      use Facebook\FacebookRedirectLoginHelper;
  
      $api_key = 'FACEBOOK_APP_ID';
      $api_secret = 'FACEBOOK_APP_SECRET';
      $redirect_login_url = 'http://www.yoursite.com/somefolder/file.php';
  / initialize your app using your key and secret
  FacebookSession::setDefaultApplication($api_key, $api_secret);
  
  // create a helper opject which is needed to create a login URL
  // the $redirect_login_url is the page a visitor will come to after login
  $helper = new FacebookRedirectLoginHelper( $redirect_login_url);
  
  // First check if this is an existing PHP session
  if ( isset( $_SESSION ) &amp;&amp; isset( $_SESSION['fb_token'] ) ) {
      // create new session from the existing PHP sesson
      $session = new FacebookSession( $_SESSION['fb_token'] );
      try {
          // validate the access_token to make sure it's still valid
          if ( !$session-&gt;validate() ) $session = null;
      } catch ( Exception $e ) {
          // catch any exceptions and set the sesson null
          $session = null;
          echo 'No session: '.$e-&gt;getMessage();
      }
  }  elseif ( empty( $session ) ) {
      // the session is empty, we create a new one
      try {
          // the visitor is redirected from the login, let's pickup the session
          $session = $helper-&gt;getSessionFromRedirect();
      } catch( FacebookRequestException $e ) {
          // Facebook has returned an error
          echo 'Facebook (session) request error: '.$e-&gt;getMessage();
      } catch( Exception $e ) {
          // Any other error
          echo 'Other (session) request error: '.$e-&gt;getMessage();
      }
  }
  if ( isset( $session ) ) {
      // store the session token into a PHP session
      $_SESSION['fb_token'] = $session-&gt;getToken();
      // and create a new Facebook session using the cururent token 
      // or from the new token we got after login
      $session = new FacebookSession( $session-&gt;getToken() );
      try {
          // with this session I will post a message to my own timeline
          $request = new FacebookRequest(
              $session, 
              'POST', 
              '/me/feed', 
              array(
                  'link' =&gt; 'www.finalwebsites.com/facebook-api-php-tutorial/',
                  'message' =&gt; 'A step by step tutorial on how to use Facebook PHP SDK v4.0'
              )
          );
          $response = $request-&gt;execute();
          $graphObject = $response-&gt;getGraphObject();
          // the POST response object 
          echo '&lt;pre&gt;' . print_r( $graphObject, 1 ) . '&lt;/pre&gt;';
          $msgid = $graphObject-&gt;getProperty('id');
      } catch ( FacebookRequestException $e ) {
          // show any error for this facebook request
          echo 'Facebook (post) request error: '.$e-&gt;getMessage();
      }
      if ( isset ( $msgid ) ) {
          // we only need to the sec. part of this ID
          $parts = explode('_', $msgid);
          try {
              $request2 = new FacebookRequest(
                  $session,
                  'GET',
                  '/'.$parts[1]
              );
              $response2 = $request2-&gt;execute();
              $graphObject2 = $response2-&gt;getGraphObject();
              // the GET response object
              echo '&lt;pre&gt;' . print_r( $graphObject2, 1 ) . '&lt;/pre&gt;';
          } catch ( FacebookRequestException $e ) {
              // show any error for this facebook request
              echo 'Facebook (get) request error: '.$e-&gt;getMessage();
          }
      }
  } else {
      // we need to create a new session, provide a login link
      echo 'No session, please &lt;a href="'. $helper-&gt;getLoginUrl( array( 'publish_actions' ) ).'"&gt;login&lt;/a&gt;.';
  }
  </code></pre>