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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:32:42+00:00 2026-05-31T18:32:42+00:00

I want to get data using CURL but I have a problem. When I

  • 0

I want to get data using CURL but I have a problem. When I set the url like this

$url = "https://graph.facebook.com/fql?q=SELECT name FROM page"; // continues

I do not have anything returned. When I copy the browser url, this is

$url = "https://graph.facebook.com/fql?q=SELECT%20name%20FROM%20page";

I get the results through CURL. I tried htmlentities and htmlspecialchars without luck.

What am I missing here?

  $ch = curl_init($url);
  curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  $content = curl_exec($ch);
  • 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-31T18:32:43+00:00Added an answer on May 31, 2026 at 6:32 pm

    you would use urlencode($string); in the curl_init(); or call the urlencode before and set it to a variable like so:

    example:

    <?php
    $url = 'https://graph.facebook.com/fql?q=';
    $query = "SELECT name FROM page WHERE page_id in(SELECT page_id, type FROM page_admin WHERE uid = me() AND type != 'APPLICATION' )&access_token=". $facebook->getAccessToken();
    $ch = curl_init(urlencode($query));
    $ch = $url.$ch;
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    $content = curl_exec($ch);
    

    php documentation: http://php.net/manual/en/function.urlencode.php


    incorrect usage of: htmlspecialchars() and htmlentities()

    htmlspecialchars() is used to strip characters and sanitize data in the URI string. use urldecode to decode the %20’s and such into their proper strings.

    Conversely use urlencode($string); to convert spaces, slashes, ampersands and other elements into their respective URL friendly counterpart.

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

Sidebar

Related Questions

I have a problem now. I want to get wikipedia data using wikimeta. I
I am using http://lite.facebook.com And i want to get some data from my account.
I have one problem , I want to get some data from XML file
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 the data every day within one year backward but I
I have image data and i want to get a sub image of that
I want to get data from an API using Python. The API documentation give
Possible Duplicate: Post data and retrieve the response using PHP Curl? I want to
I want to get data from webservice using NSXml Parser. I am able to
I am trying to get data from my Access database using like operator. For

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.