Possible Duplicate:
How can I redirect once facebook like button is clicked?
I have many facebook’s fan pages like button on my website, I want to increment a php variable $counter when someone likes any particular fan page on my web page?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should create a Facebook APP and then use the Javscript SDK: https://developers.facebook.com/docs/reference/javascript/
After importing the SDK, you should subscribe to the following event
edge.createusing this code:This will be executed when a user presses the one of the like buttons. As you can see the
responsevariable holds the “liked” url, you should pass this via AJAX call to a PHP script and if the URL is a valid URL of your pages you can increment your PHP variable.You can see all Facebook events here https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/