title: Facebook iFrame app, is this code correct?
body: <p>I've just thrown together a quick Facebook iFrame "fangate" app, where you must "like" to reveal a page.</p>
  
  <p>I've seen a number of ways of doing things online so I just wanted to check that my method was safe to use before I publish the app.</p>
  
  <p>..and the code..:</p>
  
  <pre><code>&lt;?php
  require 'facebook.php';
  
  $facebook = new Facebook(array(
  'appId' =&gt; "__CODE_HERE__",
  'secret' =&gt; "__CODE_HERE__",
  'cookie' =&gt; true
  ));
  $signed_request = $facebook-&gt;getSignedRequest();
  
      if($signed_request != false){
          if($signed_request["page"]["liked"]) {
            echo "you LIKE this page now!!";
          } else {
            // User likes the fan page.. display restricted data.
            include 'index.php';
          }
      }
      else
      {
          header('LOCATION: http://www.facebook.com/');
      }
  
    ?&gt;
  </code></pre>
  
  <p>What do you guys think? This seems pretty secure and the is the most common method i've come across. Would you include anything else?</p>
  
  <p>All feedback welcome.. :)</p>
  
  <p>--Conor</p>