আগামী ৩০ সেপ্টেম্বর থেকে Professional web Design and Development with HTML, CSS, JAVASCRIPT, PHP, MySQL, JQUERY and AJAX কোর্স এর ৯৪ তম ব্যাচ এবং ২৭ সেপ্টেম্বর থেকে Zend (PHP 7.1) Certified PHP Engineering (ZCPE) কোর্স এর ৪৪ তম ব্যাচ শুরু হতে যাচ্ছে। সীমিত সংখ্যক আসন বাকি আছে। আগ্রহীদেরকে অতিসত্বর মাসুদ আলম স্যার এর সাথে যোগাযোগ করার জন্য অনুরোধ করা যাচ্ছে। স্যার এর মোবাইল নম্বর : ০১৭২২ ৮১ ৭৫ ৯১
26 comments to “Adding Facebook Login feature to any Website”
  1. bro i am getting errors, at my localhost
    Warning: Header may not contain more than a single header, new line detected. in C:\xampp\htdocs\fb\login_facebook.php on line 24

  2. Spot on with this write-up, I truly believe this site needs a great deal more attention. I’ll probably be back again to read more, thanks for the info!

  3. really nice tutorial and worked successfully.
    I want to login directly to my site through facebook and i dont want to check database.for this what i do in this code.

    • Check on Line 66:

      remove this line and replace it with:
      $access_token = get_access_token();
      $userData = getData($access_token);

      Now you have a variable named $userData with the user’s Facebook ID, Email Address and Name, use this information to instantly signup or temporarily login the user into your site……

    • Sir, rest assured the blog’s images are working fine. Modify your Browser settings, check your internet connection, or at least clear your cache and reload the page(Ctrl+F5).

  4. siri am getting errors, at my localhost
    its cant redirect on facebook page
    this is a my login facebook.php code
    query(“SELECT id FROM users WHERE email='”.$email.”‘”);
    $array = $query->fetch_assoc();
    $_SESSION[“user”] = $array[“id”];
    header(“location: index.php”);
    header(“location: index.php”);

    header(“location: index.php”);

    if(isset($_REQUEST[“state”]) && $_REQUEST[“state”]==$_SESSION[“state”]){
    $access_token = get_access_token();
    $data = getData($access_token);


    pls help me

  5. function get_access_token(){
    global $app_secret, $app_id, $redirect_uri;

    $code = $_REQUEST[“code”];

    $call = file_get_contents(“https://graph.facebook.com/oauth/access_token?client_id=$app_id&redirect_uri=$redirect_uri&client_secret=$app_secret&code=$code”);

    return $access_token;

    Error: undefined variable $access_token

  6. Pingback: Add Login Feature To Website

Leave a Reply

Your email address will not be published.