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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:31:52+00:00 2026-06-01T01:31:52+00:00

Background: I am making a facebook app where users post messages like in a

  • 0

Background:
I am making a facebook app where users post messages like in a forum. For that I save the users facebook id to then present their names. I know it is possible to show the name out of a facebook id by using the Graph API, but I can’t make it work.

The code I use is the following:

//$fbId is the facebook id to find out the name for

$facebookUrl = "https://graph.facebook.com/".$fbId;
echo(file_get_contents($facebookUrl));
$str = file_get_contents($facebookUrl);
$result = json_decode($str);
echo($result);
return $result->name;

I researched and tested this for hours, but I feel like I’m getting nowhere. I got an idea of how it works from:

http://www.phpexpertsforum.com/how-to-get-the-facebook-name-with-user-id-using-php-code-t1852.html

Didn’t work so I researched further from here:

Get user's name from Facebook Graph API

I dowloaded and currently use the Facebook php SDK, but I don’t find the way to use it to get anyone’s name other than the current user.
The problem here seems to be the file_get_contents() function that returns a false, meaning that it can’t read the file.
I checked out the php documentation. Also, by using the php functions fopen() and file().

//echo(pathinfo($facebookUrl, PATHINFO_EXTENSION)); -> Doesn't give any response!
//echo(file_exists($facebookUrl)); -> No response!
//fopen() doesn't work
//file() doesn't work
//file_get_contents() doesn't work
//tried adding an access token to the $facebookUrl but it doesn't make any difference

Any idea of what could be wrong here? Little guidance would be very helpful. What am I doing wrong? What did I miss?

  • 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-01T01:31:54+00:00Added an answer on June 1, 2026 at 1:31 am

    Seems that your allow_url_fopen directive is set to Off.

    Look for it in your php.ini (or create a php file containing <?php phpinfo(); ?> and point to it in your browser) and check if is set to ‘On’.

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

Sidebar

Related Questions

A little background info; I'm making an iOS App that uses facebook integration. I
I am making an app that runs in the background, and starts on device
i'm making a splash image div that changes the background with different css class,
A Brief Background I'm making a conventional forum to learn/practice Rails. User Model has_many
I am making a quiz app and i have set different background music in
I'm making a python script that should run in the background and notify a
im making a mention system like the one in facebook, right now I achieved
I'm making a very simple text editor and I'd like to color the background
To give some background, I am making a UINavigationControlled-based blog type app (I suppose
I have the following HTML (note the CSS making the background black and text

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.