--- --- --- css stuff --- --- ----

59 Responses to “Login with facebook using PHP ( Demo and Download )”

  1. Esmin Kaduschic says:

    I can not take my files, because your site will not generate a link for dovnload

  2. John says:

    I cannot download the files. Where can I get the base_facebook.php and facebook.php scripts

  3. Metilic says:

    Hey, nice script, but could you modify it to just logout from the website and not distroing whole session and logging you out from facebook too?

  4. aspgod says:

    Thank you very much. That’s really help me.

  5. Rahul Shakya says:

    Awesome man, you did a great job…it reeally helped it out.

  6. Rahul Shakya says:

    after login i want it is to be redirected to some other page, for that how will i do it

    • krizna says:

      in fbconfig.php ..
      $loginUrl = $facebook->getLoginUrl(array(
      ‘scope’ => ‘email’, // Permissions to request from the user
      ‘redirect_uri’ => ‘https://http://www.krizna.com/general/login-with-facebook-using-php/’ // redirect url after login
      ));

  7. Isaac Fraire Heredia says:

    In functions.php you have this:

    $check = mysql_query(“select * from Users where Fuid=’$fbid’”);
    $check = mysql_num_rows($check);
    if (empty($check)) {

    The variable $check make redundancy and put two records duplicated into the database, I´m fixing with this

    $check = mysql_query(“select * from Users where Fuid=’$fbid’”);
    $counter = mysql_num_rows($check);
    if ($counter > 0) {

    I´am not sure using empty function because empty return true if de the variable is declared or have the value 0

    • krizna says:

      @isaacfraireheredia:disqus

      $check = mysql_num_rows($check);
      //if new user.. $check will be 0 since it will not find any record and below condition will be true .. it ill insert new record ( new user )
      if (empty($check)) {

      Now check yours

      $counter = mysql_num_rows($check);
      //if new user .. $check will be 0 .. and below condition will be false .. no record inserted..
      if ($counter > 0) {

      hope this helps u

  8. Heinz Puda says:

    Nice script, but i have a problem with this. : when I log in it works. when I click logout, I get on other side I have defined in fbconfig.php. is ok.
    but. when I open a the domain in a new brwoser windows, then I’m logged in. logout not working for me.
    if I completely close the browser, and re-open broser, I am logged out .
    please help me :)

    • Heinz Puda says:

      OMG … error found ^^

      this is your code :
      $facebook->destroySession();

      and this is my code:
      $facebook->distroySession();

      ok now it working perfect ..

      thx for the script

  9. Kishi Agrawal says:

    I am facing an error that is->Given URL is not allowed by the Application configuration.: One or more
    of the given URLs is not allowed by the App’s settings. It must match
    the Website URL or Canvas URL, or the domain must be a subdomain of one
    of the App’s domains.
    how can i solve this

  10. Raja says:

    if($user) condition false.

  11. Prathyusha Punni says:

    but i got error is “Given URL is not allowed by the Application configuration.: One or more
    of the given URLs is not allowed by the App’s settings. It must match
    the Website URL or Canvas URL, or the domain must be a subdomain of one
    of the App’s domains.” how can i solve this?

    • LM says:

      have to make sure your domain name and the domain in the app settings on facebook match, inclusing the subdomain or www. part(if you have qwerty.com on one and type http://www.qwerty.com in the other , it wont work) for same reason it doesn’t work on a localhost unless there is a workaround

    • Korede Lawrence Oluwafemi says:

      Make sure you set the site url on the app dashboard on facebook

  12. Shekhar Atole says:

    hey admin not worked in my project?? :(

  13. Agent Of Chaos says:

    Bro, thanks a lot for this. Very helpful. I’d like to just point out that this code is no longer working. But just add that big ass fb_ca_chain_bundle.crt file in the src folder and it works…but it’s not recognizing the username attribute anymore among the user details.

  14. Eduardo Vega Torres says:

    Nice job. In my case, the variable $funame is not getting the username from facebook through $fbuname = $user_profile['username']; The other vars are getting the right. Any guess?

  15. Andy says:

    I cannot log out :(

    • LM says:

      probably same issue, if i click logout it logs me out of facebook, but i stay logged in the website using this script with full access to my fb data.(just using vanilla copy of script atm). any suggestions?

      • LM says:

        only way i seem to be able to revoke access to profile is to remove app in my facebook settings. bit problem, since if someone logs into my site on a PC, then logs out, someone else comes on PC – they immediately get access to previous account since logout doesn’t work and they can see all previous users fb details displayed, without even needing a fb login :/ googling fix now, but thus far seems noone else has/has noticed this issue :(… search continues…

        • Abhijith Sasikumar says:

          Same issue here. Fixed.

          Go to index.php page. Replace the logout link with the following link:

          Logout

          go to logout.php and change the header location to your desired url.

  16. Ross says:

    The script seems awesome but it doesn’t seem to be working for me. When i press the login with facebook link It is sending me to a facebook link, but then im redirected back to the index page before i even login. Please help me! :D

  17. ckc says:

    Why I can’t show the username? (It’s use the full source of the Download Pack)

  18. Vignesh Selvam says:

    demo not working

  19. James says:

    I am getting this error: You are using a display type of ‘page’ in a small browser window or popup. For a better user experience, show this dialog with our JavaScript SDK without specifying an explicit display type. The SDK will choose the best display type for each environment. Alternatively, use display type ‘popup’ if you have special requirements precluding you from using the SDK. This message is only visible to developers of your application. Has anyone else had this problem?

  20. harjinder singh says:

    hi please help me. after login on left sidebar no friend list show it should be error Warning: Invalid argument supplied for foreach() in C:xampphtdocsfacebook_sourceindex.php on line 106 and when i click on like button it should be error. help me please. thanks in advance.

  21. Omar N Shamali says:

    your demo is fucked up dude

  22. Muhammad Nadeem says:

    good tutorial, but I have problem, I can log in with one account ( that is administrator / developer account) and unable with all others.

  23. Acp Vinay Kumar says:

    Am using subdomain for facebook login while login button is pressed a white new popup opens and doing nothng wat to do

  24. hina says:

    its work only for one id not for all.please help me to login all users.

    • vml says:

      change

      Do you want to make this app and all its live features available to the general public? to yes….

      in status & review tab of apps

  25. murali says:

    i am able to login to site,but not able to acess my details.can any one help me?

  26. murali says:

    i am able to login to site,but not able to acess my details.can any one help me?

  27. Prashant Rishi says:

    Notice: Undefined index: FBID

  28. meteerturk says:

    in functions.php, change this:
    Fuid=’$fbid’”
    to this:
    Fuid=’$fuid’”
    Or it’s gonna insert same users during every single login;)

  29. Web Alterations says:

    I have a problem where additional users are not getting added to the database when they login. any fix?

  30. Er Rajesh Dewangan says:

    when i login i my account in facebook it will redirect into my index file and i cannot see my information in my facebook

  31. Lisa says:

    Not able to get username from this script

  32. rinku_y says:

    Great job

  33. Jewin Patel says:

    when login on fb after that the profile page will not be display what i do???? its not redirect to the index file? plz help me..

  34. Er Shubham says:

    When i as doing the same i m getting this error :

    The page isn’t redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    This problem can sometimes be caused by disabling or refusing to accept cookies.

    please help me..

  35. Michel Mayor says:

    Hey – It seems like the OAuth version will be deprecated soon … Did you by any chance thought about improving the connector ? Love your work btw!

  36. vml says:

    how to get friend list and email id from this tutorial …. any one can help me please …………..

  37. Ricardo ferreira says:

    In my case. after Facebook login show error “A página Web em originou demasiados redirecionamentos.” THIS HAS HAPPENED TO ANYONE?

  38. sabatini says:

    all ok, but you cant use a pop-up?

  39. Sultan says:

    I tried above code but it displayed

    ‘The page isn’t redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    This problem can sometimes be caused by disabling or refusing to accept cookies.’ error
    i set my app domain — localhost
    and site url is –http://localhost/projectname

Leave a Reply