Home
Login Button
Custom Login Button
Permissions
Request Dialog
Invite Friends
Stream Publish
Like Button
Send Button
Like Box
Comment Box
Bookmark Button
Recommendations
Data Access
Logout Button

Facebook Login Button

Login Button control is used to connect a web site to the Facebook and allow it to use the Facebook API. It also enables the user that once he is logged, all controls from this list will work without additional logging. It is also possible to define JavaScript code which will be executed after user is successfully logged, or form id which will be submitted which allows redirection to another page, or resubmitting the current page.

For all details about the control, with descriptions of all optional properties, please visit Facebook Login Button Tutorial.


Example:

The example demonstrates login button configured with all optional parameters. Below the login button is code used for configuration. Press the login button to see how it works. When you press it, popup window will show up, and you have to enter Facebook credentials. After your successful login, you will be asked to allow the usage of extended permissions for the website (this example shows setting of email permission). After confirmation you will be redirected to another page where your basic profile data will be shown. There is also an option to set JavaScript code which will be executed after successful login.


Sign up with Facebook

// creating new instance of Login Button
$login = new LoginButton();

// Optional: setting title and size
$login->SetText("Sign up with Facebook");
$login->SetSize("small");

// Optional: setting list of extended permissions
$login->SetPermissions("email");

// Optional: setting the form id which will be submitted
// on successfull login (redirect on User Data page)
$login->SetOnLoginSubmitForm("form1");

// Render commmand on the page
$login->Render();