HomePHP Page 2 - Facebook PHP API Applications: Basic Introduction
The Facebook Like Button PHP Integration into Your Website - PHP
If you are a PHP developer interested in learning the PHP API applications of Facebook, then this tutorial can help you get started. Keep reading and you'll soon know not only how to add Facebook features to your website, but how to develop your own Facebook applications.
One of the core benefits of enabling Facebook on your website is increasing traffic. Facebook is one of the most visited websites on the Internet, with high traffic potential for your website.
How the Facebook "Like" button works and how you will use it
Imagine you have hundreds of visitors a day to your website. You can assume that the majority of them have Facebook accounts. Now if someone likes your posts, with this feature they can click the Facebook "Like" button and share that content with their friends on Facebook.
What will happen next is that your post/story will be published or appear on the person's Facebook profile update pages, like the News Feed. Your post will appear as a link pointing to your website post URL (if it is a blog).
The good thing is that once your post has been published in the news feed (because some Facebook user likes it), you might get additional traffic from referral links. This increase in traffic is beneficial, because it might translate into sales, newsletter sign-ups, etc.
If you would like to integrate this into your website using PHP, you need PHP to grab the URL of the post, and then bind it to the href value of the Facebook iFrame tag.
In PHP you can get the URL by using the following code:
The PHP variable $postURL contains the value of the post URL. Therefore, you can bind this variable to the Facebook Like Button, as shown in the following section.