RethinkingWeb | How To Add Facebook Login To your Website - RethinkingWeb
RethinkingWeb offers a multitude of web software development and digital marketing consulting services that enables you to out perform your competition
software development company, custom software development in thane, software development company in thane, mumbai software developers, PHP software development house, software developers, Digital Marketing Companies, Customized Software Quality Management, Customized Software Development Company Profile,Custom Software Applications,Build Custom Website,Affordable Custom Websites,Customized Software Definition,Free Website Design
4289
single,single-post,postid-4289,single-format-standard,ajax_leftright,page_not_loaded,smooth_scroll,,wpb-js-composer js-comp-ver-3.6.12

Blog

How To Add Facebook Login To your Website

banner_social_media_facebook1

 

Implement Login with facebook in your site.

Below steps are given :
• Go to the https://developers.facebook.com/
• Login with your facebook username and password.
• Click On Menu ‘Apps‘, If you are creating your first app Then click on ‘Register as a developer’ otherwise click on ‘Create a New App
• Popup will be display ,enter given details and click on ‘Create App’

 

blog new

 

• It will open dashboard for your app with App secret key and App Id.

 

blog newwww 2

 

 • Now Click On Settings Tab and Provide Your Domain Name in Site Url and Save It.

 

demo

 

•Now Download Facebook SDK from internet.
• Extract Zip File of SDK
• Create Folder name ‘api’ on your server.
• Keep below given files in ‘api’ folder
1. base_facebook.php
2. facebook.php
3. fb_ca_chain_bundle.crt

 Now create Login.php and Logout.php file on your server and write below given code into these files.

Login.php

<html>

<head>

<title>Facebaak Api Demo</title>

</head>

<body>

<?php

include ‘api/facebook.php’;

 

$fb =new Facebook(array(

‘appId’=>’786195678069199’,

‘secret’=>’cc1a75a71948ee70dccd9e3deeed7417’));

$user = $fb->getUser();

if($user)

{

echo ‘<a href=”logout.php”>Logout</a>’;

}else

{

$login = $fb->getLoginUrl();

echo ‘<a href=”‘.$login.'”>Login</a>’;

}

?>

 

</body>

</html>

 

Logout.php

<?php

include ‘api/facebook.php’;

$fb =new Facebook(array(

‘appId’=>’786195678069199’,

‘secret’=>’cc1a75a71948ee70dccd9e3deeed7417’,

‘cookie’=>true));

$fb->destroySession();

header(‘Location:login.php’);

?>

To Download Demo Files  Click here.

Post A Comment