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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:02:21+00:00 2026-05-29T10:02:21+00:00

I just need simple and working facebook app. I bought ssl for this and

  • 0

I just need simple and working facebook app. I bought ssl for this and i dont want too much expenses.

If user allowed app it will write his name and gender and his/her friends gender.

my app doesnt redirect after user allow the app. I cant fix it so just need basic app with out url redirecting.

ı used this code but it doesnt work. it need to be corrected:

require_once("facebook.php");
$facebook = new Facebook(array(
    'appId'  => '***',
    'secret' => '***',
  'scope'  => 'manage_pages,offline_access,publish_stream,user_photos'
));

$user = $facebook->getUser();

if ($user) {
  try {
    // Proceed knowing you have a logged in user who's authenticated.
    $user_profile = $facebook->api('/me');
  } catch (FacebookApiException $e) {
    $user = null;
  }
}

if ($user) {
  $logoutUrl = $facebook->getLogoutUrl();
} else {
  $loginUrl = $facebook->getLoginUrl();
}
  • 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-29T10:02:22+00:00Added an answer on May 29, 2026 at 10:02 am

    Here is the simple one page application full fills your needs

    make the file with name index.php

    download the facebook library download here

    <?php 
    
    require_once 'library/facebook.php';
    
    
    // Create our Application instance.
    $facebook = new Facebook(array(
      'appId' => 'appid',
      'secret' => 'secret',
      'cookie' => true,
    )); 
    
         $app_id = 'appid';
    
         $canvas_page = "canvas_page_link";
    
    
         $auth_url = "http://www.facebook.com/dialog/oauth?client_id=" 
                . $app_id . "&redirect_uri=" . urlencode($canvas_page) . ("&scope=email,read_stream&response_type=token");
    
         $signed_request = $_REQUEST["signed_request"];
    
         list($encoded_sig, $payload) = explode('.', $signed_request, 2); 
    
         $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
    
         if (empty($data["user_id"])) {
                echo("<script> top.location.href='" . $auth_url . "'</script>");
         } else {
    
         //getting the userid and some other data for verification 
    
         //get the user id 
                $UserId = $data["user_id"];
                echo 'UserId;' . $UserId;
    
        //get the user access token
                $token = $facebook->getAccessToken();
                echo "</br>" . 'Access_Token:' . $token;
    
        //set default access token and profile
                $facebook->setAccessToken($token);
                $user_profile = $facebook->api('/me');
    
         //get the user name 
                $user_id = $facebook->getUser();
                $user_profile = $facebook->api('/me','GET');
                $user_name = $user_profile['name'];
                echo "Name: " . $user_name;
                $user_gender = $user_profile['gender'];
                echo "Gender: " . $user_gender;
    
    } 
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Wow, this should be so simple, but it' just not working. I need to
I'm working in a android project the idea is simple: I just need to
I'm working on a game where the physics are very simple. I just need
I'm working on a simple app and need to add share feature to it.
i Have been given this simple task , I want to connect to facebook
I just need to rename JQgrid column dynamically as per user selection from a
I'm working on a Facebook app for book sharing, reviewing, and recommendations. I've scoured
Okay maybe i just need another set of eyes on this, but I have
I'm working on a site with a simple php-generated twitter box with user timeline
I'm working on an MVC 3 app in .NET, I don't have much experience

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.