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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:55:33+00:00 2026-05-27T13:55:33+00:00

I am new to the facebook graph API ,but I know the basics. Now

  • 0

I am new to the facebook graph API ,but I know the basics. Now I need help from you all about how to read user wall posts and others who posted on the wall of any user, with read_stream. But I don’t know how to call it. I tried some way but I was able to read just the name and basic info. I need help in reading objects. Please help me!!!

<?php
define('FACEBOOK_APP_ID', 'xxxxxx');
define('FACEBOOK_SECRET', 'xxxxxx');
function get_facebook_cookie($app_id, $application_secret) {
$args = array();
parse_str(trim($_COOKIE['fbs_' . $app_id], '\\"'), $args);
ksort($args);
$payload = '';
foreach ($args as $key => $value) {
if ($key != 'sig') {
  $payload .= $key . '=' . $value;
 }
 }
  if (md5($payload . $application_secret) != $args['sig']) {
   return null;
  }
 return $args;
  }
  $cookie = get_facebook_cookie(FACEBOOK_APP_ID, FACEBOOK_SECRET);
   ?>
   <!DOCTYPE html>
   <html xmlns="http://www.w3.org/1999/xhtml"
         xmlns:fb="http://www.facebook.com/2008/fbml">
   <body>
   <?php
   echo 'Your Facebook ID: '.$cookie;
    if ($cookie) {
   //cookie is set, user is logged in
   $user = json_decode(file_get_contents('http://graph.facebook.com/'.$cookie['uid']));
   //Display the facebook user ID, name, gender and Facebook URL in the web browser
   echo '<br />';
   echo 'Your Facebook ID: '.$user->{'id'};
   echo '<br />';
   echo 'Your name: '.$user->{'name'};
   echo '<br />';
   echo 'Your gender: '.$user->{'gender'};
   echo '<br />';
   echo 'Your Facebook URL: '.$user->{'link'};
   echo '<br />';
   echo '<img src="http://graph.facebook.com/'.$user->{'id.'/picture"                      alt="'.$user->       {'name'}.'"/>';
   echo '<br />';
   echo '<fb:login-button autologoutlink="true"></fb:login-button>';
   }
   else
   {
   //user is not logged in, display the Facebook login button
          echo '<h2>Facebook Application Test page</h2>';
   echo '<br />';
   echo' message somethng';
   </body>
   </html>
  • 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-27T13:55:33+00:00Added an answer on May 27, 2026 at 1:55 pm

    First of all you must take permission from your users

        $url = "https://graph.facebook.com/oauth/authorize?"
        ."client_id=".$app_id."&"
        ."redirect_uri=http://apps.facebook.com/".$app_name."/&scope=read_stream";
    
        <script language="javascript">window.open('<?php echo $url ?>', '_parent', '');</script>
    

    Then you can get user’s wall. There is an example here.

        if(isset($_GET["code"])){
            if(isset($_REQUEST['state']) == isset($_SESSION['state'])) {
                $token_url = "https://graph.facebook.com/oauth/access_token?"
                             . "client_id=" . $app_id . "&redirect_uri=" . "http://apps.facebook.com/".$app_name."/"
                             . "&client_secret=" . $app_secret . "&code=" . $_GET["code"];
                $response = @file_get_contents($token_url);
                $params = null;
                parse_str($response, $params);
                $graph_url = "https://graph.facebook.com/".$user_id."/feed/?access_token=".$params['access_token'];
                $user = json_decode(file_get_contents($graph_url));
                foreach($user as $feeds)
                {
                    foreach($feeds as $feed)
                    {
                        if(isset($feed->link))
                        {
                            echo $feed->link."<br>";
                        }
                    }
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know both the old Facebook REST API and the new Graph API fairly
I'm trying to use the new Facebook Graph API on my website. This is
Using PHP 5.2.11 and the new facebook graph code... If I call $facebook->api(/me); I
What's the difference between accessing user data with the Facebook Graph API ( http://graph.facebook.com/btaylor
I started developing a Facebook app using the new Graph API. I want to
I've been trying to get Rails to play with the new Facebook Graph API.
I'm trying to familiarize myself with Facebook's new Graph API and so far I
I am new to the Facebook graph API and I am currently developing my
I am new to facebook dev, I read the document but still not getting
I'm new to web development. Reading the Facebook Graph API documentation, I found it

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.