Facebook Like Gate like_status is empty
<p>so basically im trying to get a like gate working but the $like_status variable never changes so my condition to change to the liked content will never work. Does anyone know why this never changes? Have added my app to a page tab on facebook and it gets all the other variables $page_id, $page_admin, $country and $locale but not $like_status.</p>

<p>Thanks Charlie</p>

<p>See Code Below</p>

<pre><code>&lt;?php

    enter code here

require_once('AppInfo.php');

// Enforce https on production
if (substr(AppInfo::getUrl(), 0, 8) != 'https://' &amp;&amp; $_SERVER['REMOTE_ADDR'] != '127.0.0.1') {
  header('Location: https://'. $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
  exit();
}

// This provides access to helper functions defined in 'utils.php'
require_once('utils.php');


require 'includes/facebook.php';


// Create our Application instance.
$facebook = new Facebook(array(
  'appId'  =&gt; AppInfo::appID(),
  'secret' =&gt; AppInfo::appSecret(),
  'cookie' =&gt; true
));

$signed_request = $facebook-&gt;getSignedRequest();

$page_id = $signed_request["page"]["id"];
$page_admin = $signed_request["page"]["admin"];
$like_status = $signed_request["page"]["liked"];
$country = $signed_request["user"]["country"];
$locale = $signed_request["user"]["locale"];

echo "&lt;br&gt;page id = $page_id";
echo "&lt;br&gt;page admin = $page_admin";
echo "&lt;br&gt;like status = $like_status";
echo "&lt;br&gt;country = $country";
echo "&lt;br&gt;locale = $locale";

function grokSignedRequest() 
{
    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;
}



// call the function to parse the signed request
$sr_data = grokSignedRequest();



// check like status
if ($sr_data-&gt;page-&gt;liked==1) 
{
    include ('includes/index2.php');
} 

else
{
  include ('includes/index1.php');
}

?&gt;
</code></pre>
