Facebook Connect Login Button PHP class is used to connect a website and Facebook and allow the usage of Facebook API. It also enables that once a user is logged in, all controls from the library will work without additional logging in. It is also possible to define JavaScript code which will be executed after a user is successfully logged in, or form id which will be submitted. This allows redirection to another page or resubmitting of the current page. See also Facebook Login Button ASP.NET Control
Login Button Image
Following image represents three Facebook Login Buttons with different settings. The fists one from the left is the default Facebook Login Button, i.e. its size is set to medium and text is set to 'Login'. The second one is like the first one, but with changed title to 'Sign up with Facebook'. The third one differs from the previous by its size, which is set to small.
PHP Example
The example shows Facebook Login Button with defined text, required permissions, and form id which has to be submitted after user is logged in. Permissions are set to video upload and sending email, which means that Facebook Connect web site has to ask a user for approval of required permissions when the user is logged in the website for the first time. If user denies access to the permissions, he cannot be logged in. The form id is set to 'form1' which will cause the submitting of UserDataPage.php page on successfully log in. The example shows the code of whole page, but important content is highlighted: required includes and initialization for any page with brown color, and working with Facebook Login Button PHP class with blue color.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <title>Facebook Login Button PHP example</title> </head> <body> <?php require_once 'facebook.php'; require_once 'faceconn/faceconn.php'; UseGraphAPI(); ?> <form id="form1" action="UserDataPage.php"> <?php $login = new LoginButton(); $login->SetText("Sign up with Facebook"); $login->SetPermissions("video_upload, email"); $login->SetOnLoginSubmitForm("form1"); $login->Render(); $login->Render(); ?> </form> </body> </html>
Configuration
Configuration of the Facebook Login Button PHP class is done through calls of the setter methods, which in turn set the private properties. For Facebook Login Button PHP class, there are no required properties to set. All you have to do is to create new instance of the class and call Render() method. All properties from the list below are optional.

