Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6069033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:46:43+00:00 2026-05-23T09:46:43+00:00

I am using facebook PHP SDK. I need the user to login to my

  • 0

I am using facebook PHP SDK. I need the user to login to my site using their facebook account and I need to store their email, first name and last name in my database. I am using this code to login the user

 $loginUrl   = $facebook->getLoginUrl(
        array(
            'scope'         => 'user_photos,user_videos,email,offline_access,publish_stream,user_birthday,user_location,user_work_history,user_about_me,user_hometown',
            'redirect_uri'  => $fbconfig['baseurl']
        )
);

My problem is how can I retrieve the information after the user login and rediret back to my site.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:46:44+00:00Added an answer on May 23, 2026 at 9:46 am

    Something along the lines of..

    $user = $facebook->getUser();
    

    OR

    $user = $facebook->api('/me');
    

    This will return an array that includes all the public information that FB generally gives out. (i.e.- name, birthday, email, etc.)

    Now I’m sure you can access the user’s email as such,

    $userEmail = $user['email'];
    

    To check out everything it returns specifically,

    print_r($user);
    

    For more example code, check out Facebook’s PHP SDK

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Facebook's PHP SDK, I was able to get Facebook login working pretty quickly
Using the Facebook PHP SDK, what steps do I need to take to allow
So when I use Facebook's PHP SDK 3.0.1, using their example.php (you can find
Ok so I'm using Facebook PHP SDK currently I'm rendering the login/logout buttons as
so I'm using the Facebook PHP SDK for authenticating my user.... and I'm trying
I'm using facebook php sdk to get friend list of an user. But I'm
I am using Facebook PHP SDK to authenticate the user. After generating the LoginUrl
I have downloaded php-sdk for using facebook in php. I also created facebook application
I am using the PHP library for the Graph API ( http://github.com/facebook/php-sdk ) but
I am using Facebook PHP SDK 3.0 I would like to know how could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.