Use Facebook PHP SDK v5 to create login URL - create Facebook callback page to get an access token - use the access token to get user profile data from Facebook. Facebook will also update the javascript sdk soon, so later you can use the login/logout system of javascript api with php sdk. But for now you should use fully php base authentication. I have created 4 files in this tutorial, first one is config.php, this file stores Facebook app ID, app SECRET and database information needed by other files.Second one is the index.php, front page for user interaction where visitors see Facebook Login button, from this page ajax requests will be sent to server. Facebook API tutorial for PHP. With the Graph API and the Facebook Login feature it’s possible to authenticate users in your web application and upload or post.
The Facebook PHP SDK is a powerful library that allows developers to easily integrate Facebook login and make requests to the Graph API. In this post, we’ll go over how to install, initialize and perform operations like posting to timelines, user registrations, logins and more! A very easy step by step quick start tutorial for using facebook javascript api. Tutorials; Facebook C# API Tutorials; PHP Tutorials. Login()” method. Login With Facebook PHP CodeIgniter: OAuth Login Neeraj Agarwal OAuth is simply an open authentication that is used for providing access to the server data after authorizing a user via third party services.
We can use Facebook login to allow the users to get access into the websites. This page will explain you about login with facebook PHP SDK.
Need to go https://developers.facebook.com/apps/ and click on add a new group button to make the app ID.
Choose Website
Give an app name and click on Create New Facebook App ID
Click on Create app ID
Click on Skip Quick Test
On Final stage, it will show as below shown image.
Now download zip from here
Now open fbconfig.php file and add you app ID and app Secrete
Finally fbconfig.php file as shown below −
Login page is used to login into FB
Index page is as shown below.
It will produce the result. Before trying this example, please logout your face book account in your browser.
Below code is used to logout facebook.