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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:00:01+00:00 2026-05-30T15:00:01+00:00

Cannot open My application, I am a newbie to Facebook Application Development I simply

  • 0

Cannot open My application,
I am a newbie to Facebook Application Development
I simply want to fetch user name of logged user and display it
but i cannot login and i always get error messages

this is the simple code copied for developer.facebook.com

I also tried specifying permission and redirect url, but still its of no use
PLEASE HELP OUT, i have been stuck for past two days

here is the code for PHP page

<?
  // Remember to copy files from the SDK's src/ directory to a
  // directory in your application on the server, such as php-sdk/
  require_once('src/facebook.php');

  config = array(
    'appId' => '***',
    'secret' => '***',
  );

  $facebook = new Facebook($config);
  $user_id = $facebook->getUser();
?>
<html>
  <head></head>
  <body>

  <?
    if($user_id) {

      // We have a user ID, so probably a logged in user.
      // If not, we'll get an exception, which we handle below.
      try {

        $user_profile = $facebook->api('/me','GET');
        echo "Name: " . $user_profile['name'];

      } catch(FacebookApiException $e) {
        // If the user is logged out, you can have a 
        // user ID even though the access token is invalid.
        // In this case, we'll get an exception, so we'll
        // just ask the user to login again here.
        $standalone_url = 'http://localhost/trial/';
        $login_url = $facebook->getLoginUrl(array(
        'next' => $standalone_url.'next.php', 
                'redirect_uri' =>  $standalone_url.'message.php',
        'scope' => 'user_about_me'));
        echo 'Please <a href="' . $login_url . '">login.</a>';
        error_log($e->getType());
        error_log($e->getMessage());
      }   
    } else {

      // No user, print a link for the user to login
      $login_url = $facebook->getLoginUrl();
      echo 'Please <a href="' . $login_url . '">login.</a>';

    }

  ?>

  </body>
</html>

i have tried/ already

a) Cleared all Web cache n history(web Browser: Firefox)

b) also deleted java applets and application CACHE

Please See the image in URL
to get more clear picture

trial

error

  • 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-30T15:00:03+00:00Added an answer on May 30, 2026 at 3:00 pm

    In image you share your redirect uri is: http://localhost/trial/index.php
    which does not match your canvas uri in your configuration panel: https://developers.facebook.com/apps

    So solution is: your redirect must exactly match with canvas url even trailing slash:
    http://my_app.com/

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

Sidebar

Related Questions

I cannot open a new window in QT. I new in QT so I
I cannot understand the Oracle documentation. :-( Does anybody know how to fetch multiple
context in the application Lokalize http://www3.pic-upload.de/24.06.10/ycpxjk6ikvxz.png All I see is just the file name
We have JSF web application that generates XLS file and gives user link to
Newbie C++ programmer here. I'm trying to write a command line application that takes
I am running the demo application that is supplied with the facebook-ios-sdk. The application
I have a managed DLL that I want to use in a legacy application
Is there a way to open the app store to a specific application? I
I'm a newbie to android development so please bear with me. My question is
I have a C application running on Linux and it processes thousands of messages...but

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.