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

  • SEARCH
  • Home
  • 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 8964773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:39:52+00:00 2026-06-15T16:39:52+00:00

I am creating an app in facebook and when user enters my app then

  • 0

I am creating an app in facebook and when user enters my app then the authentication will happen and after that i will get the access token and id of user now i want the details of the same user and i have to store that in database …. how to do this
CODE I HAVE TRIED IS

 <?php 

     $app_id = "xxxxxxxxxxx";

     $canvas_page = "xxxxxxxxxxxxx";

     $auth_url = "https://www.facebook.com/dialog/oauth?client_id=" 
            . $app_id . "&redirect_uri=" . urlencode($canvas_page)."&scope=email,user_birthday";

     $signed_request = $_REQUEST["signed_request"];
     //print_r($signed_request);

     list($encoded_sig, $payload) = explode('.', $signed_request, 2); 
     //print_r($payload);

     $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
     //print_r($data);

      if(!isset ($_GET['code'])) {
                        if (empty($data["user_id"])) {
                          echo("<script> top.location.href='" . $auth_url . "'</script>");
                   } else {
                        $accessToken = $data["oauth_token"];

                          echo ("<br/><br/>Welcome User: " . $data["user_id"]);
                   } 
      } else {
          echo("<script> top.location.href='" . $pageUrl . "'</script>");
      }

 ?>

Now i want the username and other details in string or array format …
Please help me….

  • 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-06-15T16:39:53+00:00Added an answer on June 15, 2026 at 4:39 pm

    Using this Graph api :

    https://graph.facebook.com/me?access_token=XXXXXXXXXXXXXXX
    

    You can choose the fields you want returned using the fields query parameter:

    https://graph.facebook.com/me?fields=id,name

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

Sidebar

Related Questions

I'm creating an iphone app using Facebook apis. I need to get the user's
I'm creating an app that will need users to create an account. (Like Facebook
I'm creating an app in Titanium that uses the Facebook Graph API to get
I'm creating an iPhone App that uses facebook connect to enable the user to
I am creating a Java web app that is meant for use by Facebook
I am creating an app in C# where the user enters their name and
I am creating an app that will point a simple arrow in the direction
I'm creating my facebook APP with Html iframe. I need , when the user
I am creating an app for Facebook and twitter integration using sharekit. That works
I am creating iphone app with facebook graph api. I am able to get

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.