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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:08:02+00:00 2026-05-16T16:08:02+00:00

I want to access https://graph.facebook.com/19165649929?fields=name (obviously it’s also accessable with http) with cURL to

  • 0

I want to access https://graph.facebook.com/19165649929?fields=name (obviously it’s also accessable with “http”) with cURL to get the file’s content, more specific: I need the “name” (it’s json).
Since allow_url_fopen is disabled on my webserver, I can’t use get_file_contents! So I tried it this way:

<?php
$page = 'http://graph.facebook.com/19165649929?fields=name';
$ch = curl_init();
//$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
//curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_URL, $page);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
?>

With that code I get a blank page! When I use another page, like http://www.google.com it works like a charm (I get the page’s content). I guess facebook is checking something I don’t know… What can it be? How can I make the code work? Thanks!

  • 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-16T16:08:03+00:00Added an answer on May 16, 2026 at 4:08 pm

    did you double post this here?
    php: Get html source code with cURL

    however in the thread above we found your problem beeing unable to resolve the host and this was the solution:

    //$url = "https://graph.facebook.com/19165649929?fields=name";
    $url = "https://66.220.146.224/19165649929?fields=name";
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: graph.facebook.com'));
    $output = curl_exec($ch);
    curl_close($ch); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i used the user's valid access token to identify the user... with this: https://graph.facebook.com/me?fields=id&access_token=VALID_ACCESS_TOKEN
I want to capture the access_token returned by this url(below) https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&redirect_uri=YOUR_REDIRECT_URI&client_secret=YOUR_APP_SECRET&code=CODE_GENERATED_BY_FACEBOOK But if I
I have this code: $url=https://graph.facebook.com/me/friends?access_token=.$access_token.&fields=id,first_name,last_name&limit=10; $content=file_get_contents($url); Whenever I use this on a non authenticated
The following curl command works as expected: curl 'https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=myappid&client_secret=myclientsecret' I want to do the
I want to send app request to user of app Facebook. https://graph.facebook.com/myid_facebook/apprequests?message= test &data=
I want to get info (text and uid) from comments in my application. https://graph.facebook.com/commentID
I want to redirect users trying to access http://example.com/car/ to http://example.com/car/blue/ in .htaccess I
I want to access the Facebook Graph API and get JSON responses like this:
This FQL multiquery, for example: https://graph.facebook.com/fql?q={posts:SELECT actor_id,message,permalink,created_time,comments.count FROM stream WHERE source_id=me(),actors:SELECT uid,name,pic_square,profile_url FROM user
$url = https://graph.facebook.com/fql?q=SELECT%20uid2%20FROM%20friend%20WHERE%20uid1=me()&access_token=sadfasdf; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER,

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.