Last active
September 27, 2015 11:27
-
-
Save ericnkatz/1262096 to your computer and use it in GitHub Desktop.
Check if person "Likes" the facebook page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Check to see if a person likes the current facebook page. | |
*/ | |
$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