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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:53:20+00:00 2026-06-03T20:53:20+00:00

Here is My code : <? session_start(); require_once($_SERVER[‘DOCUMENT_ROOT’].’/admin/config.php’); require_once($_SERVER[‘DOCUMENT_ROOT’].’/admin/fonctions.php’); include ‘../api/facebook.php’; include ‘../api/xhttp.php’; $config

  • 0

Here is My code :

<?
session_start();

require_once($_SERVER['DOCUMENT_ROOT'].'/admin/config.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/admin/fonctions.php');

include '../api/facebook.php';
include '../api/xhttp.php';


  $config = array();
  $config['appId'] = '35455XXXXXXX207';
  $config['secret'] = '6006855f3aXXXXXXXXX9bce45a426';
  $config['fileUpload'] = false; // optional

  $facebook = new Facebook($config);


$args = array(
    'message'   => 'Hello from my App!',
    'link'      => 'http://www.masteringapi.com/',
    'caption'   => 'Visit MasteringAPI.com For Facebook API Tutorials!',
    'access_token'  => $access_token
);

$retour_login = json_decode(stripslashes($_GET['session']), true);
$uid = $retour_login['uid'];
$access_token = $retour_login['access_token'];

$post_id = $facebook->api("/me/feed", "post", $args);

?>

But it returns : Uncaught OAuthException: An active access token must be used to query information about the current user.
Any ideas ?

Thanks!


Here is My new code :

<?


  $config = array();
  $config['appId'] = '3545XXXXXXX6207';
  $config['secret'] = '60068XXXXXXXXXXXe45a426';


  $facebook = new Facebook($config);


$retour_login = json_decode(stripslashes($_GET['session']), true);
$uid = $retour_login['uid'];
$access_token = $retour_login['access_token'];


$me = null;
// Session based API call.
if ($session) {
  try {
    $uid = $facebook->getUser();
    $me = $facebook->api('/me');
  } catch (FacebookApiException $e) {
    error_log($e);
  }
}

if(!isset($_GET['session'])) {
    $params = array(
    'locale' => 'fr_FR',
    'display' => 'popup', 
    'req_perms' => 'email,user_about_me,user_birthday,user_location',
    'ext_perms' => 'publish_stream,share_item,manage_pages'
    );
    header("Location: ".$facebook->getLoginUrl($params));
}



        $args = array(
                'message'   => "XXXX",
                'link'      => 'XXXX',
                'name'      => 'XXXX',
                'picture'   => 'XXXX',
                "caption"=> "lien.com",
                      "type"=> "link");

        $post_id = $facebook->api("/me/links", "post", $args);

?>

This time i get this error : OAuthException: (#282) Requires extended permission: share_item thrown

Any ideas ?

Thanks!

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

    You’re not passing it the access token.

    Check out getAccessToken().

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

Sidebar

Related Questions

here is the code <?php session_start(); if(!isset($_SESSION['user_name'])) { header('Location: login.php'); } $conn = mysql_connect(localhost,
Here is the code: <?php //Starting session session_start(); //Includes mass includes containing all the
Here is te code: <?php //Starting session session_start(); //Includes mass includes containing all the
my code for the php page displaying the divs <?php session_start(); require_once(classlib/mainspace.php); if (isset($_SESSION['username'])==FALSE)
Here's my code: <?php session_start(); require(validationLibrary.php); $_SESSION['validForm'] = true; if($_SESSION['validForm'] == true){ header(Location: registerFormTwo.php);
<?php session_start(); require_once 'facebook.php'; $app_id = 418907881455014; $app_secret = 36389d2c4caaf6de86982cb87686a494; $redirect_uri = 'http://gooogle12.comuf.com'; $facebook
here is code for regular expression matching #include<iostream> #include<stdio.h> #include<string.h> using namespace std; int
I want to change tab name of a facebook page. Here is the code
I am trying to log in using this code : session_start(); require connect.php; $username
Ok the error is showing up somewhere in this here code if($error==false) { $query

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.