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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:37:47+00:00 2026-06-06T22:37:47+00:00

I am using php-sdk for showing facebook information of the user. I have successfully

  • 0

I am using php-sdk for showing facebook information of the user. I have successfully shown the user profile info but while fetching any album or photos I am getting the blank data to me. I read the photos requires access_token.
Also if I put this query in the facebook graph api explorer it showing me the perfect result. So query is right may be my way of passing the url is wrong.

I am not getting the issue.
Please help.
‘;
$app_secret = ”;
$my_url = ”;

          $config = array(
            'appId' => '<appid>',
            'secret' => '<appsecrete>',
           );

            $facebook = new Facebook($config);
            $user_id = $facebook->getUser();

            $code = $_REQUEST["code"];
            if($user_id) {
             //auth user
             if(empty($code)) {
                $dialog_url = 'https://www.facebook.com/dialog/oauth?client_id=' 
                    . $app_id . '&redirect_uri=' . urlencode($my_url) ;
                    echo("<script>top.location.href='" . $dialog_url . "'</script>");
              }

              //get user access_token
              $token_url = 'https://graph.facebook.com/oauth/access_token?client_id='
                . $app_id . '&redirect_uri=' . urlencode($my_url) 
                . '&client_secret=' . $app_secret 
                . '&code=' . $code;
              $access_token = file_get_contents($token_url);

             $fql_query_url = 'https://graph.facebook.com/'.'fql?q=SELECT+pid,src_small+FROM+photo+WHERE+aid+IN+(SELECT+aid+FROM+album+WHERE+owner=+me())&'.$access_token;
             $fql_query_result = file_get_contents($fql_query_url);
             $fql_query_obj = json_decode($fql_query_result, true);


          //display results of fql query
          echo '<pre>';
          print_r("query results:");
          print_r($fql_query_obj);
          echo '</pre>';

}
?>

  • 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-06T22:37:48+00:00Added an answer on June 6, 2026 at 10:37 pm

    One parameter needs to be add for $dialog_url variable which is ‘scope’ which defines permissions to be given for application

    $dialog_url = 'https://www.facebook.com/dialog/oauth/?client_id='.$app_id.'&redirect_uri='.urlencode($my_url).'&scope=user_photos';
                        echo("<script>top.location.href='" . $dialog_url . "'</script>");
    

    for reference,

    http://developers.facebook.com/docs/reference/dialogs/oauth/

    Thanks

    Shreyas

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

Sidebar

Related Questions

I have been using php-sdk to connect to facebook for a while and I
I have written a simple facebook application using PHP SDK. Application works well but
I have a Facebook application where I authorize the user using the PHP SDK.
I am using facebook PHP SDK. After the user allows my application, facebook redirects
I'm using the latest PHP SDK and have tried $facebook->('/me/friends?fields=installed') and it tells me
I have downloaded php-sdk for using facebook in php. I also created facebook application
I am using the PHP library for the Graph API ( http://github.com/facebook/php-sdk ) but
I am using Facebook PHP SDK to authenticate the user. After generating the LoginUrl
so I'm using the Facebook PHP SDK for authenticating my user.... and I'm trying
I am integration Facebook connect in my website using php SDK.. Everything is working

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.