Simple login with facebook

->first download  required file from below link

https://www.dropbox.com/s/1k4gg6lwdvs3vxy/fb.zip?dl=0

->create fb button 

<a href="<?php echo base_url('fb/fbconfig.php');?>"><button class="btn btn-primary" type="button">Login With Facebook</button></a>    


in FB/ fb config  file set  App key and App secret 


********* how to  get app key and App secret 

go  to 
 
https://developers.facebook.com/quickstarts/?platform=web

From  my app option select add  new App 


select platform for which you want to add your App 

you get your api key and secret key as below 



from setting  menu  please set your app domain here i ma using for localhost 




From App detail optin set your Application detail


******

you can do what you want after checking  successful login

if(isset($_SESSION['FBID']) && $_SESSION['FBID'] != '' )
                {
                            $tmpname= explode(' ',$_SESSION['FULLNAME']);
                           $firstName=$tmpname[0];
                           $lastName=$tmpname[1];
                          $emailId=$_SESSION['EMAIL'];
                 }

Thanks









 


  





 

 


Comments

Popular posts from this blog

Connect multiple database and call in code igniter

Call CI controler functiona from View using ajax

Pay using braintree