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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:10:08+00:00 2026-05-23T10:10:08+00:00

I have a small issue. I want to load this page ‘http://www.facebook.com/feeds/page.php?id=57084011597&format=rss20’ using curl.

  • 0

I have a small issue. I want to load this page ‘http://www.facebook.com/feeds/page.php?id=57084011597&format=rss20’ using curl. Here is the code I am trying t use, nut I can’t get aything back from it.

    $head=array('Accept'=>'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
                    'Accept-Charset'=>'ISO-8859-2,utf-8;q=0.7,*;q=0.3',
                    'Accept-Encoding'=>'gzip,deflate,sdch',
                    'Accept-Language'=>'ro-RO,ro;q=0.8,en-US;q=0.6,en;q=0.4',
                    'Cache-Control'=>'max-age=0',
                    'Connection'=>'keep-alive',
                    'Cookie'=>'datr=hroHTi2NZk2KleOaswb03Q_Q; lu=gg9lJcPeInHt6hnut7bviqQg; locale=en_US; e=n; L=2; c_user=100000596376783; sct=1309129360; xs=2%3Ad05dd80e364608525dd664ad73f6483f; act=1309410851554%2F5; presence=EM309410852L4N0_5dEp_5f1B00596376783F1X309410852168Y0Z11G309410768PCC',
                    'Host'=>'www.facebook.com',
                    'User-Agent'=>$_SERVER['HTTP_USER_AGENT']);  
$url='http://www.facebook.com/feeds/page.php?id=57084011597&format=rss20';
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, $url); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); 
    curl_setopt($ch, CURLOPT_TIMEOUT, 20); 
    curl_setopt($ch, CURLOPT_HTTPHEADER,$head);
     $result = curl_exec($ch);

        return $result;

I’ve tried without setting a header but it also didn’t worked.
Hope that somebody coud give me a clue.

Thank you!

  • 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-23T10:10:09+00:00Added an answer on May 23, 2026 at 10:10 am

    This is your problem: $ur='http://www.facebook.com/feeds/page.php?id=57084011597&format=rss20';. You’re missing an “l”.

    $url='http://www.facebook.com/feeds/page.php?id=57084011597&format=rss20';
    

    Also, there’s a redirect so you’ll need to add:

    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    

    This how I found out. I enabled verbose output using curl_setopt($ch, CURLOPT_VERBOSE, true); and saw this:

    < HTTP/1.1 302 Found
    < Location: http://www.facebook.com/common/browser.php
    < Content-Type: text/html; charset=utf-8
    < X-FB-Server: 10.43.97.37
    < X-Cnection: close
    < Date: Thu, 30 Jun 2011 06:48:54 GMT
    < Content-Length: 0
    

    Update, tested and working:

    Facebook expects a user-agent string to be specified. Setting it with curl_setopt($ch, CURLOPT_USERAGENT, '...'); seems to solve the problem. Here’s an over-simplistic example which should solve your problem:

    <?php
    
    $ch = curl_init('http://www.facebook.com/feeds/page.php?id=57084011597&format=rss20');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_USERAGENT, array('User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Safari/534.45'));
    
    $response = curl_exec($ch);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a small issue here. I have a button in a form (this
I have a small issue. Sometimes when I debug an application I want to
I am working on a small code snippet. The Issue: I want to have
I have a simple, general question regarding a real small issue that bothers me:
I have a small issue with iAP. I have the code working for the
I have a small issue with a stored procedure in SQL Server 2005. RepInfoID(primary),
I'm creating Bluetooth custom application, but I have a small issue. When in my
I got a small issue. I have a detail view with a button. When
I have a small app using Drive.Info. I want to do two things. Check
I have a small issue with a CA2000 warning. In my project which is

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.