I have a Facebook Tab that is fan-gated using the below code:
<?php
require 'facebook.php';
$app_id ="APP_ID";
$app_secret ="APP_SECRET";
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
$signed_request = $facebook->getSignedRequest();
$like_status = $signed_request["page"]["liked"];
?>
<?php if ($like_status) { ?>
<?php } else { ?>
Page overlay hides page content for non-fans.
<?php } ?>
Page content here...
The app lets the user submit a form using method="post". When the form is submitted the page is reloaded and a success-message is shown instead of the form. The URL does not change.
The problem however is that when the form is submitted the page overlay is visible even though the page is liked.
The like gate works perfectly fine for showing/hiding the overlay for the page before the form is submitted.
Any help will be greatly appreciated. Thanks.
Best, Alexander