• Esmin Kaduschic

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

    • krizna

      please try now .. sorry for the late reply

      • gopinath dhara

        in database records are not inserted and after login it returns back home page…..database is empty please help me out

        • yendys

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

          • Er Rajesh Dewangan

            same problem i found

  • Esmin Kaduschic

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

    • http://www.krizna.com krizna

      please try now .. sorry for the late reply

      • gopinath dhara

        in database records are not inserted and after login it returns back home page…..database is empty please help me out

        • yendys

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

          • Er Rajesh Dewangan

            same problem i found

  • John

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

  • John

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

  • Metilic

    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?

    • tyujnhg

      ubnhjb

  • Metilic

    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?

    • tyujnhg

      ubnhjb

  • aspgod

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

  • aspgod

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

  • Rahul Shakya

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

  • Rahul Shakya

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

  • Rahul Shakya

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

    • krizna

      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
      ));

      • vml

        how to get friend list & friend’s email id of user who is login through ur script

  • Rahul Shakya

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

    • http://www.krizna.com krizna

      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
      ));

      • vml

        how to get friend list & friend’s email id of user who is login through ur script

  • Isaac Fraire Heredia

    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

      @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

  • http://www.krizna.com krizna

    @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

  • Heinz Puda

    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

      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

      • Nika Potskhveria

        where is this code?
        I can’t find :(

        • http://www.fantasticgamez.com Hammad Evo

          Hi, Nika I have an issue “This webpage has a redirect loop” can you help me regarding this. I will be thankful.

  • Heinz Puda

    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

      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

      • Nika Potskhveria

        where is this code?
        I can’t find :(

        • http://www.fantasticgamez.com Hammad Evo

          Hi, Nika I have an issue “This webpage has a redirect loop” can you help me regarding this. I will be thankful.

      • Modou S. Kebbeh

        Hi, am having the same problem.I can logout from my website but if i open facebook in new tab i still have a session.I want to kill all facebook session on logout.Thanks for this great piece of code

  • Kishi Agrawal

    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

    • http://www.mybody.ro/ Marius Herea

      Make sure to add platform before adding the url, to avoid the error

  • Kishi Agrawal

    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

    • http://www.mybody.ro/ Marius Herea

      Make sure to add platform before adding the url, to avoid the error

      • Deb Nandan Dutta

        check the 19th line’s of fbconfig.php file

  • Pingback: Anonymous()

  • Raja

    if($user) condition false.

  • Raja

    if($user) condition false.

  • Prathyusha Punni

    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

      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

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

  • Prathyusha Punni

    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

      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

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

    • Shivrajan Singh

      I have the same issue please help us

  • Shekhar Atole

    hey admin not worked in my project?? :(

  • Shekhar Atole

    hey admin not worked in my project?? :(

  • Agent Of Chaos

    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.

  • Agent Of Chaos

    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.

  • Eduardo Vega Torres

    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?

    • Samir Kumar

      same on my case bro what to do?

  • Eduardo Vega Torres

    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?

    • Samir Kumar

      same on my case bro what to do?

  • Andy

    I cannot log out :(

    • LM

      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

        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

          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.

    • http://www.fantasticgamez.com Hammad Evo

      madam, can you help me, I have ”

      This webpage has a redirect loop” issue coming up. thanks.

  • Andy

    I cannot log out :(

    • LM

      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

        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

          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.

    • http://www.fantasticgamez.com Hammad Evo

      madam, can you help me, I have ”

      This webpage has a redirect loop” issue coming up. thanks.

  • Ross

    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! 😀

  • ckc

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

  • ckc

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

  • Vignesh Selvam

    demo not working

  • Vignesh Selvam

    demo not working

  • James

    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?

  • James

    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?

  • harjinder singh

    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.

    • vml

      can u tell me how to get friend list from this tutorial’s demo code ??

  • harjinder singh

    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.

    • vml

      can u tell me how to get friend list from this tutorial’s demo code ??

  • Omar N Shamali

    your demo is fucked up dude

  • Omar N Shamali

    your demo is fucked up dude

  • Pingback: unable to login to my website with facebook login()

  • Muhammad Nadeem

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

    • Ozsvár István

      I have the same problem. :(

  • Muhammad Nadeem

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

    • Ozsvár István

      I have the same problem. :(

  • Acp Vinay Kumar

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

    • http://www.fantasticgamez.com Hammad Evo

      Hi, vinay Is this problem solved, I have ”

      This webpage has a redirect loop” issue, can anybody help me?

  • Acp Vinay Kumar

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

    • http://www.fantasticgamez.com Hammad Evo

      Hi, vinay Is this problem solved, I have ”

      This webpage has a redirect loop” issue, can anybody help me?

  • hina

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

    • vml

      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

  • hina

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

    • vml

      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

  • murali

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

  • murali

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

  • murali

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

  • murali

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

  • Prashant Rishi

    Notice: Undefined index: FBID

    • disizmeanup

      you can write
      (isset($_SESSION[‘FBID’]))

    • http://www.fantasticgamez.com Hammad Evo

      sir, can you help me, I have

      “This webpage has a redirect loop” issue.

  • Prashant Rishi

    Notice: Undefined index: FBID

    • disizmeanup

      you can write
      (isset($_SESSION[‘FBID’]))

    • http://www.fantasticgamez.com Hammad Evo

      sir, can you help me, I have

      “This webpage has a redirect loop” issue.

  • meteerturk

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

    • http://www.fantasticgamez.com Hammad Evo

      sir, can you help me plz, I have

      “This webpage has a redirect loop” issue.

  • meteerturk

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

    • http://www.fantasticgamez.com Hammad Evo

      sir, can you help me plz, I have

      “This webpage has a redirect loop” issue.

  • Web Alterations

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

  • Web Alterations

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

  • Er Rajesh Dewangan

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

    • Jewin Patel

      hey bro plz help me

      • ghostmiro

        hi Jewin, can you give me the solution plz? thx

    • http://www.fantasticgamez.com Hammad Evo

      Sir, can you help me I have

      “This webpage has a redirect loop” issue. plz help me

  • Er Rajesh Dewangan

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

    • Jewin Patel

      hey bro plz help me

      • ghostmiro

        hi Jewin, can you give me the solution plz? thx

    • http://www.fantasticgamez.com Hammad Evo

      Sir, can you help me I have

      “This webpage has a redirect loop” issue. plz help me

  • Lisa

    Not able to get username from this script

  • Lisa

    Not able to get username from this script

  • rinku_y

    Great job

  • http://reesu.org/ Rinku Yadav

    Great job

  • Jewin Patel

    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..

  • http://technicus.in Er Shubham

    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..

    • http://www.fantasticgamez.com Hammad Evo

      I have the same Issue can anyone help me,

      “This webpage has a redirect loop”

  • http://technicus.in Er Shubham

    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..

  • Michel Mayor

    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!

  • Michel Mayor

    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!

  • vml

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

  • vml

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

  • Ricardo ferreira

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

  • Ricardo ferreira

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

  • sabatini

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

  • sabatini

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

  • Sultan

    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

  • Sultan

    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

  • Marcel Marcel

    after login i cant see my FB email adres. The other things are ok!
    i am using your demo files.

    can you help me out?

    • Terry

      at bottom of fbconfig.php
      change
      $loginUrl = $helper->getLoginUrl();
      to
      $loginUrl = $helper->getLoginUrl(array(‘req_perms’ => ’email’));

      • tashfene

        Thankyou Terry!

      • Karen

        It works thanks! x

      • http://www.fantasticgamez.com Hammad Evo

        Hi terry I have “This webpage has a redirect loop” issue while trying to login using facebook php sdk. plz help me.

  • Marcel Marcel

    after login i cant see my FB email adres. The other things are ok!
    i am using your demo files.

    can you help me out?

    • Terry

      at bottom of fbconfig.php
      change
      $loginUrl = $helper->getLoginUrl();
      to
      $loginUrl = $helper->getLoginUrl(array(‘req_perms’ => ’email’));

      • tashfene

        Thankyou Terry!

      • Karen

        It works thanks! x

      • http://www.fantasticgamez.com Hammad Evo

        Hi terry I have “This webpage has a redirect loop” issue while trying to login using facebook php sdk. plz help me.

  • Abdul Karim

    Thank’s work done..

  • Abdul Karim

    Thank’s work done..

  • Abdul Karim

    how to get country code or name

  • Abdul Karim

    how to get country code or name

  • http://ri-cyber.blogspot.com Rifqi Irsyadillah

    Fatal error: Call to undefined function FacebookHttpClientsmb_substr() in /home/username/public_html/src/Facebook/HttpClients/FacebookCurlHttpClient.php on line 254

  • http://ri-cyber.blogspot.com Rifqi Irsyadillah

    Fatal error: Call to undefined function FacebookHttpClientsmb_substr() in /home/username/public_html/src/Facebook/HttpClients/FacebookCurlHttpClient.php on line 254

  • sirajuddin

    gejcode not Get value

    protected function getCode()
    {
    return isset($_GET[‘code’]) ? $_GET[‘code’] : null;
    }

  • kaizaru

    need help… everything displays properly except for the email.. the email address does not display

  • kaizaru

    need help… everything displays properly except for the email.. the email address does not display

  • Henry

    logout not work. Any solutions?

    • Henry

      It doesent logout from website. I try to logout and redirect to indexpage. After that I hit to login button and yahuu I am back logged in with the same Facebook account.

  • Henry

    logout not work. Any solutions?

    • Henry

      It doesent logout from website. I try to logout and redirect to indexpage. After that I hit to login button and yahuu I am back logged in with the same Facebook account.

  • Wasim Hossain

    good

  • Wasim Hossain

    good

  • natcha sechele

    eish m having so many errors while trying to use this files.Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or ‘(‘ in C:wampwww1353fbconfig.php on line 6

  • natcha sechele

    eish m having so many errors while trying to use this files.Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or ‘(‘ in C:wampwww1353fbconfig.php on line 6

  • Cesar Aquino

    MUCHAS GRACIAS

  • Cesar Aquino

    MUCHAS GRACIAS

  • satish

    How can get email, existing code is not retuning email, please guide

    • Guest

      Yes I have the same problem too! And I couldnt fetch other properties as well. Any idea on how to return email please? x

      • Karen

        Terry’s comment below was the solution! However, I am unable to return other properties… x

  • satish

    How can get email, existing code is not retuning email, please guide

    • Guest

      Yes I have the same problem too! And I couldnt fetch other properties as well. Any idea on how to return email please? x

      • Karen

        Terry’s comment below was the solution! However, I am unable to return other properties… x

  • Radovedni Par

    Can you tell me, if this code use API v1 or API v2 facebook login?

  • Radovedni Par

    Can you tell me, if this code use API v1 or API v2 facebook login?

  • Bharani

    I get this error : Fatal error: Uncaught exception ‘Exception’ with message ‘The Facebook SDK v4 requires PHP version 5.4 or higher.’ in /home/u240484366/public_html/autoload.php:32 Stack trace: #0 /home/u240484366/public_html/fbconfig.php(4): require_once() #1 {main} thrown in /home/u240484366/public_html/autoload.php on line 32

    Can anyone help me pls… Thanks in advance

    • http://www.mybody.ro/ Marius Herea

      Have your hosting provider upgrade php to 5.4

  • Bharani

    I get this error : Fatal error: Uncaught exception ‘Exception’ with message ‘The Facebook SDK v4 requires PHP version 5.4 or higher.’ in /home/u240484366/public_html/autoload.php:32 Stack trace: #0 /home/u240484366/public_html/fbconfig.php(4): require_once() #1 {main} thrown in /home/u240484366/public_html/autoload.php on line 32

    Can anyone help me pls… Thanks in advance

    • http://www.mybody.ro/ Marius Herea

      Have your hosting provider upgrade php to 5.4

  • Karen

    Hello, I was able to get other properties ,ie. locale with
    $fLocale = $graphObject->getProperty(‘locale’);

    however, I would like to ask how could I get the “name” of “location”? I have tried the following but does not work…

    $fHomeTown = $graphObject->getProperty(‘hometown’)->getProperty(‘name’);
    OR
    $fHomeTown = $graphObject->getProperty(‘hometown’)->’name’;
    $fHomeTwn = $fHomeTown->getProperty(‘name’);

    It would be nice if someone could help me with it, cheers!
    x

  • Karen

    Hello, I was able to get other properties ,ie. locale with
    $fLocale = $graphObject->getProperty(‘locale’);

    however, I would like to ask how could I get the “name” of “location”? I have tried the following but does not work…

    $fHomeTown = $graphObject->getProperty(‘hometown’)->getProperty(‘name’);
    OR
    $fHomeTown = $graphObject->getProperty(‘hometown’)->’name’;
    $fHomeTwn = $fHomeTown->getProperty(‘name’);

    It would be nice if someone could help me with it, cheers!
    x

  • Sabar Djatmiko
  • Sabar Djatmiko
  • sabatini

    hello, I activated the facebook connect. But when I login I dont get the authorization screen. how do I make see?

    Thank You

    this page:
    https://developers.facebook.com/docs/facebook-login/permissions/v2.2#reference-public_profile

    you do not understand what code to write and where to put it

  • sabatini

    hello, I activated the facebook connect. But when I login I dont get the authorization screen. how do I make see?

    Thank You

    this page:
    https://developers.facebook.com/docs/facebook-login/permissions/v2.2#reference-public_profile

    you do not understand what code to write and where to put it

  • sabatini

    hello, I activated the facebook connect. But when I login I dont get the authorization screen. how do I make see?

    Thank You

    this page:
    ithttps://developers.facebook.com/docs/facebook-login/permissions/v2.2

    you do not understand what code to write and where to put

  • sabatini

    hello, I activated the facebook connect. But when I login I dont get the authorization screen. how do I make see?

    Thank You

    this page:
    ithttps://developers.facebook.com/docs/facebook-login/permissions/v2.2

    you do not understand what code to write and where to put

  • sabatini
  • sabatini
  • Douglas Cirqueira

    I did not see your solution for the problem
    “This webpage has a redirect loop”
    So, your code did not work.

  • harish

    awesome 100% workinh :)

    • venky

      hello bro u get the output 100%

      pls help me i use above fb code its nice work but one error issue i can’t get EMAIL in redirect details ??

      • San Deep Malik

        Hi Venky,
        To get email id, you have to replace $loginUrl = $helper->getLoginUrl();
        with $loginUrl = $helper->getLoginUrl( array(‘scope’ => ’email,read_stream’)); in fbconfig.php in line no. 49…
        Aadrsh also give the solution for this(in above comments)
        Regards,
        SanDeep Malik

        • venky

          thanks bro

  • pooja

    please any one can tell me how to reterive user interest from facebook within this code

  • dax

    only email which is taken at the time of creating app key and secret can login ,other user can’t login

  • Sandip Shinde

    hello, i was trying to do login for by facebook for my website but it show me the following error.”

    This webpage has a redirect loop”

  • Sandip Shinde

    reply me argent plz.

  • Fernando

    Hello,

    I am getting this error

    Fatal error: Class ‘FacebookEntitiesAccessToken’ not found in /home/u552202982/public_html/src/Facebook/FacebookSession.php on line 74

  • shariar61

    I nearly finished all tutorials/code snippets I found Googling, but until I found this one I couldnt get the hang of it.
    Thank You for providing such a awesome tutorial. I will come frequently here to read more of your tutorials.
    Keep uploading this great things.
    As i found that many of the users are having problem to display the FB username .

    Here is the solution, that worked for me:

    -on index.php change to

    on line 24 or anywhere you want to display username. Because the FB username is set in $_SESSION[‘FULLNAME’].

    Check the fbconfig.php on line 39 for clarification.

    Happy Coding.

  • Mohd Adnan Khan

    Hi,
    The Overall Demo is working properly but the LOGOUT FUNCTIONALITY is not working.
    When I Login through this demo and clicks on logout button. It redirects me to home.But when I again click on Login it shows me the details of previous one.
    It means session is not destroying.

    Also When I open the Facebook account it already shows login.

    So please provide me the solution for this through which i can Destroy the SESSION completely

    • Jugal Baruah

      facing same problem.pls help anyone

  • Daksa Media

    Hai Krizna, I got problem on my site.
    After login, I redirected to login state index again.
    Could you help me? What was I doing wrong?
    Thank you.

  • Green

    hello
    nice job i use your fb code its nice work but one error issue i can’t get EMAIL in redirect details ??

    • Adarsh

      replace
      $loginUrl = $helper->getLoginUrl();

      with
      $loginUrl = $helper->getLoginUrl( array(‘scope’ => ’email,read_stream’));

      • http://miasto-muzyki.com ShutteR

        Read_stream is deprecated.

  • bhargavi

    hi i am using the above code, but logout part is not working. Can you help me?

  • ihshan

    Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or ‘

    • ihshan

      HLO FRINDS

  • william karno

    i can not get my facebook permission??

  • chandramouly kandachar

    i have the same issue over here

    • naqqash

      i have the same issue This webpage has a redirect loop

      • dsfsdfsf

        i have the same issue over here

        • Raja Kumar

          i have the same issue over here

          • asfasf

            i have the same issue but i no how to solve it

  • Mohammed S. Yaghi

    How can I get user phone no ?

  • San Deep Malik

    Hi, Krizna,
    Thanks for this useful tutorial but logout not working .. Could you please help me out, how i implement getLogoutUrl() function??

    Thanks in advance..

  • Ravikumar Phad

    How to Insert the FBID,FULLNAME,EMAIL not insert into Database….Please Help me on this

  • Yordi Wyckmans

    I’ve got the following problem: After logging in the script redirects again to the login function.. So i don’t get to see the content of the site.

    Anyone who can help me? :p

  • Ed Vizenor

    This no longer gets emails? Did Facebook Change something?

  • http://ozwebdev.com Fauzi Priyatama

    autoload.php error, please help me

  • http://ozwebdev.com Fauzi Priyatama

    PHP Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/host/public_html/login/facebook/src/Facebook/FacebookRedirectLoginHelper.php on line 185

    please help me

  • micky

    thanks…nice job

  • Vipin Kumar

    what can i do dro
    Cannot redeclare class GraphObject in /home/jensoftw/public_html/vipin/src/Facebook/GraphObject.php on line 33

  • Johan Guzman Gil

    it is possible to get the user password also?

    • Arnaud

      try {
      $pass = $helper->getPeoplesLife();
      } catch( FacebookRequestException $ex ) {
      // emmm
      }

  • naqqash

    This webpage has a redirect loop

  • Rezky Balweel

    hai, how can i show my facebook wall post with this code?

  • Cristian Gaita

    I’m getting “Given URL is not allowed by the Application configuration…” error. The app settings looks ok, the right URL is there, everywhere, checked “Embedded browser OAuth Login”, enabled the platform, inserted cod & secret, but still not working. any ideas?
    thnx!

  • Amine Tbaik

    there’s one little bug, is that when i open my facebook page in a new tab and disconnect
    i go back to the index.php and the session is still alive
    and it shows all the session variables are still stored
    and you need to click on logout in order to unset it
    when it doesn’t get destroyed when facebook is disconnected
    knowing that there’s an if statement
    please clarify

  • Pingback: Facebook : Invalid or no certificate authority found, using bundled information - DexPage()

  • fullfuntoo

    Anyone facing problem like blank page etc please note that fb sdk needs php 5.4 or above.

    • ioanoir

      me too !!!

  • Pingback: Login and Registeration through Facebook | Colors Of Bliss()

  • Shen Siddharta Excel

    is it means only get fuid, fusername, and email?

  • Sandor

    Thanks for the tutorial!
    How about assented letters? The app gives me the following: Márkus instead of Márkus. Any trick to fix this? Thanks

  • Shah Parth

    hi

    Is it neccessary to submit app before we can use it?
    i have created an app and make it live but i did not submit it for rview yet

    I am not able to get login

  • Vipul Gholap

    i want mobile number and email id to

  • Vipul Gholap

    nice but i am not getting email id , i want email id and mobile number to
    any solution?

  • Pingback: How to ask user denied permissions while login with Facebook until user accept all permissions - DexPage()

  • http://www.tutoground.com/ Akhilesh Singh

    Hi I have added $loginUrl = $helper->getLoginUrl( array(‘scope’ => ’email’)); in fbconfig file and also found an option to allow email, but still not getting email in $graphObject variable please help

  • Hilson

    Model Is Deprecated Use as a basis and require in controller ex{ require ‘dbconfig.php’; }

    prepare(‘SELECT * from Users WHERE Fuid = :fuid’);
    $check->bindParam(‘:fuid’, $fuid);
    $check->execute();
    $results = $check->fetchAll();

    if (count($results) == 0 ) {

    $stmt = $dbh->prepare(“INSERT INTO Users (Fuid,Ffname,Femail) VALUES (:fuid, :ffname, :femail);”);
    $stmt->bindParam(‘:fuid’, $fuid);
    $stmt->bindParam(‘:ffname’, $ffname);
    $stmt->bindParam(‘:femail’, $femail);
    $stmt->execute();

    }else{
    if ($results[0][‘Fuid’] !== $fuid) {
    $stmt = $dbh->prepare(“INSERT INTO Users (Fuid,Ffname,Femail) VALUES (:fuid, :ffname, :femail);”);
    $stmt->bindParam(‘:fuid’, $fuid);
    $stmt->bindParam(‘:ffname’, $ffname);
    $stmt->bindParam(‘:femail’, $femail);
    $stmt->execute();
    }else{
    $stmt = $dbh->prepare(“UPDATE Users SET Ffname=:ffname, Femail=:femail where Fuid=:fuid”);
    $stmt->bindParam(‘:fuid’, $fuid);
    $stmt->bindParam(‘:ffname’, $ffname);
    $stmt->bindParam(‘:femail’, $femail);
    $stmt->execute();
    }
    }

    }

    ?>

  • sandeep

    using this script can we post on users time line please help i got error
    Fatal error: Uncaught exception ‘FacebookFacebookPermissionException’ with message ‘(#200) The user hasn’t authorized the application to perform this action’ in

  • Leo Masta Kusuma

    $session = $helper->getSessionFromRedirect();
    why session empty ??

  • Shivani Sehdev

    Given URL is not permitted by the Application configuration: One or more
    of the given URLs is not permitted 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.

  • Nick Thomas

    Anyone know why I would be getting a 500 Internal Server Error? I uploaded the demo file to my hosting account and that’s the error I get when I click the Facebook login.

  • http://tjn.com Partho Protim

    great! but no data is being saved in my database although as you described.

    • Christophe Revault

      Did you find the solution to save the data in your database ?

  • Faizan Zafar

    It is a good script but i have a problem whenever i click on login button it just takes me to fbconfig.php page and stop plzz suggest somthing

  • Сергей Левченков

    Very helpfull

  • http://tjn.com Partho Protim

    i get only full name and facebook id, not the email. I need permission using scope partameter. But where to include that FB.login()…………. code?

    • Ray

      how did you get full name ?? not working with me … thanks

  • Felipe

    Anybody else having problem withe the email????????????
    PLEASE HELP HERE!

  • Rajendra Modukuri

    Hai I am working with this script. It is very nice article. The problem is in this code email is not getting. I want Mobile number and email id of login users. Is it possible? please help me

    • fanwosu

      update this line on index $helper->getLoginUrl(array(’email’))

  • Sandip Shitole

    Hi I have added $loginUrl = $helper->getLoginUrl( array(‘scope’ => ’email’)); in fbconfig file and also found an option to allow email, but still not getting email in $graphObject variable please help

  • Sandip Shitole

    thanks for tutorial ,it’s working fine for me ,but the issue is i m nt getting user email,plz help,,thanks in advance…!

  • priyanka

    how to fetch the name of friend list from facebook

    • Christophe Revault

      Hey, did you find a solution ?

      • احمد البب

        hope this helping: $loginUrl = $helper->getLoginUrl(array(‘scope’ => ’email, public_profile,user_friends’));

  • Andrew

    Has anyone figured out how to retreive the email into the $graphObject object?

    • احمد البب

      alter yours to this: $loginUrl = $helper->getLoginUrl(array(‘scope’ => ’email, public_profile,user_friends’));

  • Sunny

    hi,this is working fine but it will not return email address . so how i got email address for login user ? help me .

    • احمد البب

      try this: $loginUrl = $helper->getLoginUrl(array(‘scope’ => ’email, public_profile,user_friends’));

  • Sujeet Salunke

    i didn’t get facebook email with is plugin

    • احمد البب

      try alter your code to this: $loginUrl = $helper->getLoginUrl(array(‘scope’ => ’email, public_profile,user_friends’));

  • Trien Nguyen

    I using $loginUrl = $helper->getLoginUrl(array(
    ‘scope’ => ’email’
    ));
    header(“Location: “.$loginUrl);
    I can’t read email of user. Please help me. My app id: 618088084999378, app secret: 47279391f70fb1c6028c6212a8a5f34f

    • scorpioniz

      if someone still need to get email or other data… I just found solution..

      where is line “$request = new FacebookRequest( $session, ‘GET’, ‘/me’ );”
      add to URL address more fields like this:
      “$request = new FacebookRequest( $session, ‘GET’, ‘/me?locale=en_US&fields=first_name,last_name,email’ );”

      • samphors

        HI, I have followed your line of code but there was not email returning. Do you have other solution?

        • Krzysztof Bankert

          do you have any solution of this? w have same thing, i followed this line of code and nothing … :/

          • احمد البب

            $loginUrl = $helper->getLoginUrl(array(‘scope’ => ’email, public_profile,user_friends’));

  • scorpioniz

    if someone still need to get email or other data… I just found solution..

    where is line “$request = new FacebookRequest( $session, ‘GET’, ‘/me’ );”
    add to URL address more fields like this:
    “$request = new FacebookRequest( $session, ‘GET’, ‘/me?locale=en_US&fields=first_name,last_name,email’ );”

    • Akshaya Kumar

      DUDE YOU ARE SO AWESOME THANKS!

  • Denys Guerra Moreno

    Notice: Undefined index: FBID in C:xampphtdocsiniciarfbindex.php on line 11

    11

    ayuda porfa :(

  • Denys Guerra Moreno

    Notice: Undefined index: FBID in C:xampphtdocsiniciarfbindex.php on line 11
    11

    please help :(

  • Denys Guerra Moreno

    11

    Notice: Undefined index: FBID in C:xampphtdocsiniciarfbindex.php on line 11

    please help :(

  • Denys Guerra Moreno

    esta linea me marca error

    Notice: Undefined index: FBID in C:xampphtdocsiniciarfbindex.php on line 11

    ayuda porfavor :(

  • Denys Guerra Moreno

    php if ($_SESSION[‘FBID’]):

  • Denys Guerra Moreno

    php if ($_SESSION[‘FBID’]):

    Notice: Undefined index: FBID in C:xampphtdocsiniciarfbindex.php on line 11

    alguien puede ayudarme :(

  • rj

    logout not working

  • bharati bane

    code not working it shows error abou FBID please give correct zip file

  • Anish

    How can i get about_me information of an user. My app is approved for this info.

  • Trustmaster

    Im 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.”

  • Bala

    i m getng error pls help me

    Given URL is not permitted by the Application configuration: One or more of the given URLs is not permitted 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.

  • Dannie Yo

    thanks buddy. nice posting. very easy to understand.

  • Raj Nerella

    Thanks for your post, its very descriptive. I’m getting Internal server error when I click on login with facebook button.

  • Laxman Mali

    Parse error: syntax error, unexpected T_OBJECT_OPERATOR in
    /home/u579934992/public_html/src/Facebook/FacebookRedirectLoginHelper.php
    on line 181 please solve this error

  • Pingback: Answer for FB login integration on website - Tech Magazine()

  • Danny Akhmad Zulfikar

    Fatal error: Call to undefined function FacebookHttpClientsmb_substr() in /home/plazgem9/public_html/src/Facebook/HttpClients/FacebookCurlHttpClient.php on line 254

    What it is mean ?
    Please Help me!

  • Pingback: Facebook PHP SDK Redirection loop on simple login script on localhost - Tech Magazine()

  • Pingback: Facebook API with PHP - To get name of property - Tech Magazine()

  • Raja Makassar

    good job ,,,, thanks bro ,,, your code fix my problem

  • Danny Akhmad Zulfikar

    How to fix this error ?
    Fatal error: Call to undefined function FacebookHttpClientsmb_substr() in /home/plazgem9/public_html/facebook/facebook-php-sdk-v4-4.0-dev/src/Facebook/HttpClients/FacebookCurlHttpClient.php on line 266

  • Anat Orr

    I just change the app ID, secure number and url and get this error:
    Fatal error: Call to undefined function setDefaultApplication() ,can you help please?

  • Anat Orr

    fbconfig.php not working (white screen) can you help?

  • Pingback: Parsing Facebook Graph JSON Objects in PHP | akrox58()

  • Tohamas

    here is the email fix,
    $request = new FacebookRequest( $session, ‘GET’, ‘/me?locale=en_US&fields=id,name,email’ );

    • Ethan Hunt

      awesome!!!!!!!!!!!

      • Nguyen Quoc Hung

        Amazing. Works perfectly

    • Awais Tkd

      you are awesome!!!!

  • Leandro Chaves

    Thank you guy. With some adjusts it worked fine here. :)

  • mitho

    Thankx a lot ! its working very fine and it were so easy with help of your tutorial and code :)

  • Rayniel Llanes

    Email and Name showing !!!

    ffbconfig.php

    // see if we have a session

    if ( isset( $session ) ) {

    // graph api request for user data

    $request = new FacebookRequest( $session, ‘GET’, ‘/me?locale=en_US&fields=name,email’ );

    $response = $request->execute();

    // get response

    $graphObject = $response->getGraphObject();

    $fbid = $graphObject->getProperty(‘id’); // To Get Facebook ID

    $fbfullname = $graphObject->getProperty(‘name’); // To Get Facebook full name

    $femail = $graphObject->getProperty(’email’); // To Get Facebook email ID

    /* —- Session Variables —–*/

    $_SESSION[‘FBID’] = $fbid;

    $_SESSION[‘FULLNAME’] = $fbfullname;

    $_SESSION[‘EMAIL’] = $femail;

    /* —- header location after session —-*/

    require ‘functions.php’;

    checkuser($fbid,$fbfullname,$femail);

    header(“Location: index.php”);

    } else {

    $loginUrl = $helper->getLoginUrl(array(‘req_perms’ => ’email’));

    require ‘functions.php’;

    header(“Location: “.$loginUrl);

    }

    end of fbconfig.php

    Saving Data Solved ….. edit functions.php

  • King Cricket

    CAN ANYBODY PROVIDE THE LATEST CODDING FOR GET BELOW DETAILS?
    Facebook user’s details (id, username, first_name, last_name, gender, e-m-a-i-l)

    THANKS IN ADVANCE :)

  • Deepak Goud

    i have used your code , all information got but still email id not , plz tell me

  • Deepak Goud

    plz reply to me for email id not getting from this code

  • manish

    it’s giving some error. why

    1st error: Undefined index: FBID in C:wampwww1353index.php on line 11

  • manish

    overall it’s working except this error. thank you

  • iv4nk

    Fatal error: Uncaught exception ‘Exception’ with message ‘The
    Facebook SDK v4 requires PHP version 5.4 or higher.’ in
    /home/prosebelas/public_html/users/autoload.php:32
    Stack trace:
    #0 /home/prosebelas/public_html/users/fbconfig.php(4): require_once()
    #1 {main}
    thrown in /home/prosebelas/public_html/users/autoload.php on line 32

  • Grow

    session_start(); if that code have it doesn’t work. why?