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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:03:31+00:00 2026-06-14T20:03:31+00:00

I am using facebook app that can publish message on users wall , My

  • 0

I am using facebook app that can publish message on users wall , My Error Message :

Fatal error: Call to protected method BaseFacebook::getUserAccessToken() from context '' in /home/tillaf/public_html/facebook/login_facebook2.php on line 61

My file :

<?php 

         require_once("facebook.php");

       @session_start();
       $app_id = "********";
       $app_secret = "*********";
       $my_url = "http://t.****.net/**/login.php/";

    ///
       $config = array();
      $config['appId'] = '408682199198463';
      $config['secret'] = 'd5b3c0ddfbd673dd94494f28524c1a84';
      $config['fileUpload'] = false; // optional

        $facebook = new Facebook($config);
       ///

    ////




    ////


      $code = $_REQUEST["code"];

       if(empty($code)) {
         $_SESSION['state'] = md5(uniqid(rand(), TRUE)); // CSRF protection
         $dialog_url = "https://www.facebook.com/dialog/oauth?client_id=" 
           . $app_id . "&redirect_uri=" . urlencode($my_url) . "&state="
           . $_SESSION['state'] . "&scope=user_birthday,read_stream,publish_stream,email,user_status,offline_access";

         echo("<script> top.location.href='" . $dialog_url . "'</script>");
       }
       else{

         $user_id = $facebook->getUser();
         echo $user_id;
         echo "<br/>";


    ////////// Get Access Token 

    /*
    $app_token_url = "https://graph.facebook.com/oauth/access_token?"
            . "client_id=" . $app_id
            . "&client_secret=" . $app_secret 
            . "&grant_type=client_credentials";

            $response = file_get_contents($app_token_url);
            $params = null;
        parse_str($response, $params);

        echo("This app's access token is: " . $params['access_token']);

    */
    ///-------------

    $user_access_token = $facebook->getUserAccessToken();

    ////////     




         ////// Start publish on wall


         //$facebook->getAccessTokenFromCode($_GET['code']);

         $message='ssss';
         $link='http://www.google.com';
         $name='Samilox';
         $caption='s';
         $description='Descrption...';

        $facebook->api("/me/feed",'POST',
                   array( 'access_token' =>$user_access_token,
                     'message' => 'Hello World!',
                     'link' => 'www.example.com'
                        )
                );
         ///
       }


     ?>

Sorry For Code 🙂 because i am trying many solutions before i post this question .

Please Can anyone help ?
Thanks in advance

  • 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-14T20:03:32+00:00Added an answer on June 14, 2026 at 8:03 pm

    I fixed it use :

    //// Add AccessToken for curren session

      function getAccessToken() {
        if ($this->accessToken !== null) {
          return $this->accessToken;
        }
    
        $this->setAccessToken($this->getApplicationAccessToken());
        $user_access_token = $this->getUserAccessToken();
        if ($user_access_token) {
          $this->setAccessToken($user_access_token);
        }
    
        return $this->accessToken;
      }
    
       function getApplicationAccessToken() {
        return $this->appId.'|'.$this->appSecret;
    }
    

    ////

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

Sidebar

Related Questions

I'm using facebook connect so that users can publish comments they are leaving on
I have a facebook app that I authenticate using a general-purpose authentification. Like this:
I have built a Facebook app using the Javascript SDK that has been up
I have a facebook app using a lot of Javascript that doesn't work correctly
I'm developing an HTML app that integrates Facebook Graph API using Javascript SDK. Facebook
I've created a simple facebook app that can run as a tab on a
I'm making a simple Facebook app that posts updates to the user's timeline using
Is it possible to post to a friends wall/timeline in facebook using an app
Using the Facebook Graph API and the PHP SDK, I know that I can
I have a Facebook app that is built as an iFrame. I am using

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.