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

  • Home
  • SEARCH
  • 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 5953241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:47:48+00:00 2026-05-22T17:47:48+00:00

I am about to start a new project building a web UI with a

  • 0

I am about to start a new project building a web UI with a lot of different functionality. Part of the functions however include the ability to update and access certain social media sites – Facebook and Twitter primarily.

I would like the user to login to the system and then also have the ability to manage multiple FB/Twitter accounts so that they can interact with these all from one place without having to authenticate every time they go to do something. For security reasons I obviously don’t want to store passwords, but I’m not sure how to go about this one.

I know it’s possible – does anyone have any pointers on how to go about this?

FYI – I’m programming in PHP, Javascript/Jquery. 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-05-22T17:47:49+00:00Added an answer on May 22, 2026 at 5:47 pm

    Here is the Facebook part. A good and easy way to do that is to use the Facebook PHP SDK (see on github). So you will have something like :

    require "facebook.php";
    $facebook = new Facebook(array(
        'appId'  => YOUR_APP_ID,
        'secret' => YOUR_APP_SECRET,
    ));
    
    $user = $facebook->getUser();
    

    If the user is logged in, then $user is his Facebook ID. You then have to check if you have a valid access token by making an API call :

    • If it does not raise any exception, then you have a valid access token

    • If it does, then you have to re-authenticate the user.

    Here you go :

    if ($user) {
      try {
        $facebook->api('/me');
      } catch (FacebookApiException $e) {
        $user = null;
      }
    }
    

    You need then to display the login or logout link :

    <?php if ($user): ?>
        <a href="<?php echo $facebook->getLogoutUrl() ?>">Logout of Facebook</a>
    <?php else: ?>
        <a href="<?php echo $facebook->getLoginUrl() ?>">Login with Facebook</a>
    <?php endif ?>
    

    When the user is logged in and you have a valid access token, you can make API calls to get data from Facebook :

    $user_profile = $facebook->api('/me');
    

    You may want to check the example page of the Facebook PHP SDK which is well documented.

    Hope that helps.

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

Sidebar

Related Questions

I'm going to start a new project that's building web apps from scratch. I
I am getting ready to start building a new web project in my spare
I'm about to start building a new asp.net project, and I'm just starting out
I am about to start a new project and would like to document its
We're about to start a new project, and our client's current application is .NET
I'm about to start a project for a customer who wants CMS-like functionality. They
We are about to start a new project for a server application, for the
I am about to start a new project. Using VS2010, Silverlight 4, and RIA
I'm about to start a new django project with friends. This project includes a
I am about to start a new realtime project. Now there is (again) the

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.