Skip to content

Instantly share code, notes, and snippets.

@hedcler
Created July 20, 2012 19:03
Show Gist options
  • Save hedcler/3152600 to your computer and use it in GitHub Desktop.
Save hedcler/3152600 to your computer and use it in GitHub Desktop.
Verify if user like my Facebook FãPage
<?php
$signed_request = $_REQUEST["signed_request"];
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
if (empty($data["page"]["liked"])) {
echo "You are not a fan!";
} else {
echo "Welcome back fan!";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment