title: How to create a fan / like gate on Facebook?
body: <p>I am trying to create a simple fan/like gate. Where you specify one content for none fans and other content for fans (if they pressed the like button). However when I run the page in the page tab it does not return a signed request and thus there is no way for me to figure out how to do it. Can someone post a tutorial, or have a fix for this? At this point I got the following code:</p>
  
  <p><strong>index.php</strong></p>
  
  <pre><code>&lt;?php
  require dirname( __FILE__ ) . '/../api/facebook.php';
  
  // Create our application instance
  // (replace this with your appId and secret).
  $facebook = new Facebook(array(
    'appId'  =&gt; '112458478872227',
    'secret' =&gt; 'X',
    'cookie' =&gt; true
  ));
  
  $signed_request = $facebook-&gt;getSignedRequest();
  ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="nl"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  
      &lt;title&gt;Home&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;?php 
  if ( $signed_request['page']['liked'] ) 
  {
      echo 'A fan';
  }
  else
  {
      echo 'Not a fan yet.';
  }
  ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Link:</strong></p>
  
  <p><a href="http://www.facebook.com/talkieslifestylemagazine?sk=app_112458478872227" rel="nofollow">http://www.facebook.com/talkieslifestylemagazine?sk=app_112458478872227</a></p>
  
  <p><strong>Faceook App:</strong></p>
  
  <p>Page Tab</p>
  
  <ul>
  <li>Page Tab Name: Home </li>
  <li>Page Tab URL: <a href="http://apps.talkiesmagazine.eu/facebook/home" rel="nofollow">http://apps.talkiesmagazine.eu/facebook/home</a></li>
  <li>Secure Page Tab URL :empty</li>
  <li>Page Tab Edit URL : empty</li>
  </ul>