/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $session = $facebook->getSession(); $user = $facebook->getUser(); $page = 'PAGEID'; // Session based API call. if ($session) { try { 'SELECT target_id FROM connection WHERE source_id =' . $user . 'AND target_id =' .$page )); // user has NOT Liked the page echo "Like my page!"; } else { // user HAS Liked the page echo "Thank you for liking my page"; } } catch (FacebookApiException $e) { } } ?>