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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:23:59+00:00 2026-06-05T07:23:59+00:00

require_once ‘library/facebook/facebook.php’; $facebook = new Facebook(array( ‘appId’ => ‘appid’, ‘secret’ => ‘secret’, )); $signed_request

  • 0
require_once 'library/facebook/facebook.php';

$facebook = new Facebook(array(
'appId'  => 'appid',
'secret' => 'secret',
));

$signed_request = $_REQUEST["signed_request"];
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);

How to get UID after the above code.

  • 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-05T07:24:00+00:00Added an answer on June 5, 2026 at 7:24 am

    You dont need to include facebook api for this. Just to this,

    $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
    echo $data["user_id"];
    

    This is a complete list of other info in $data array.

    {
      "algorithm": "HMAC-SHA256",
      "expires": 1317243600,
      "issued_at": 1317239909,
      "oauth_token": "<token>",
      "page": {
        "id": "<id>",
        "liked": false,
        "admin": true
      },
      "user": {
        "country": "in",
        "locale": "en_GB",
        "age": {
          "min": 21
        }
      },
      "user_id": "<user-id>"
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 very simple scripts: <?php require_once 'facebook.php'; $facebook = new Facebook(array( 'appId'
require_once'modules/logger.php'; $Logger = new Logger(); require_once 'templates/list.php'; $Templates = new templatesList(); require_once 'widgets/list.php'; $Widgets
require_once('classes/class.validation.php'); $array = $_POST['array']; $pass_profanity = false; $validation = new Validation; function check_for_profanity($input){ if(is_array($input)){
I'm using require_once() in header.php to include the FirePHP library. In the page.php I'm
I have some files: core.php : require_once 'logger.php'; require_once 'smth_else.php'; $Logger = new Logger();
This is my code : <?php require_once 'classes/dbconnect.php'; $connector = new dbconnect(); pp(); function
require_once('Class.php'); $myArray = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); // etc which is correct? foreach($myArray as $key => $val)
class_1.php class class_1 { public function __construct() { require_once $_SERVER['DOCUMENT_ROOT'].'/array.php'; } } class_2.php class
<?php require_once('inc/dbc1.php'); $pdo = new PDO('mysql:host=###;dbname=#####', $username, $password); $pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); $sth =
code sample require_once 'excel/PHPExcel.php'; require_once 'excel/PHPExcel/Cell/AdvancedValueBinder.php'; PHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() ); $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('A1', '12/08/2010') ->setCellValue('A2',

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.