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 8354971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:43:11+00:00 2026-06-09T09:43:11+00:00

I am using the following code to get permissions for my app(the code is

  • 0

I am using the following code to get permissions for my app(the code is in index.php)-

   <?php
  require_once "sdk/facebook.php";

   $fbconfig['appid'] = "333446170045623";
  $fbconfig['secret'] = "9ea7b92bc7eac852a3900e1d7931c34d";

   $facebook = new Facebook(array(
        'appId' => $fbconfig['appid'],
        'secret' => $fbconfig['secret'],
        'cookie' => true,
    ));

   $user = $facebook->getUser();

  if (!$user) { /* If user not found, authenticate */
$loginUrl = $facebook->getLoginUrl(
        array(
            'scope' => 'publish_stream',
            'redirect_uri' => 'http://www.facebook.com/pages/pagename?sk=app_333446170045623'
        ));
  echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
   }

  $signed_request = $facebook->getSignedRequest();
      ?>

Now, there’s a link on the page which takes the user to a select.php page. There I have tried to use the following code to get info about the current user-

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

I have placed the same permission retreival code as the index.php page on this page.

However, I get the following error on this page-

Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown in /server/html/appname/sdk/base_facebook.php on line 1106

I have tried the various suggested solutions but they dont seem to work. How do I use $facebook->api(‘/me’) to get the info on this page? (btw I am using facebook’s latest php sdk)

  • 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-09T09:43:13+00:00Added an answer on June 9, 2026 at 9:43 am

    Not sure why, but using the getAccessToken() method before using

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

    will stop giving the error.

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

Sidebar

Related Questions

I'm using the following code to get response from a requested page using php
I'm using the PHP Facebook SDK (v.3.1.1) for building my Facebook app. At some
I'm using this code: $facebook->api('/me/likes/', 'post', array('url' => 'http://www.google.com')); I get the following error:
I am using following code to get bitmap from url. This function is used
I am using following code to get source for image in wpf (image is
I am using following code to get current latitude and longitude. But none of
I am using the following code to get the Google Plus posts, public class
I'm using the following code to get a list of all installed apps on
I'm using the following code to get an array with all sub directories from
I am using the following code to get make an IMAP connection. I am

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.