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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:17:33+00:00 2026-06-07T00:17:33+00:00

I am implementing the facebook connect and its working partially well for me. Its

  • 0

I am implementing the facebook connect and its working partially well for me. Its successfully loging the user when some login in with facebook. Here is the link for login http://beta-demo.info/party/users/loginByFacebook but after login when i am trying to fetch user detail from facebook its now displaying anything.

Here is the code of of Fb_Connect.php This file is placed in Libraries folder

<?php
include(APPPATH.'libraries/facebook/facebook.php');
class Fb_connect extends Facebook{

    //declare public variables
    public  $user           = NULL;
    public  $user_id        = FALSE;

    public $fb          = FALSE;
    public $fbSession   = FALSE;
    public $appkey      = 0;

    //constructor method.
    public function __construct()
    {
                $CI = & get_instance();
                $CI->config->load("facebook",TRUE);
                $config = $CI->config->item('facebook');
                parent::__construct($config);
                $this->user_id = $this->getUser(); // New code

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

} // end class

and this is loging function

function loginByFacebook(){
            $this->load->library('fb_connect');
            $param['redirect_uri']=base_url();
            redirect($this->fb_connect->getLoginUrl($param));
    }

and this is the info function where i am trying to fetch the value.

function facebook() {   
print('<pre>');
print_r($this->fb_connect);
        if (!$this->fb_connect->user_id) {
        echo 'No working ';
            //Handle not logged in,
        } else {
        echo   $fb_uid = $this->fb_connect->user_id;
         echo  $fb_usr = $this->fb_connect->user;
           //Hanlde user logged in, you can update your session with the available data
           //print_r($fb_usr) will help to see what is returned
        }
}

Url of the info page http://beta-demo.info/party/users/facebook

I dont have much of idea about facebook connect API.so please help me

  • 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-07T00:17:36+00:00Added an answer on June 7, 2026 at 12:17 am

    This is the working code for me

    <?php
       function loginByFacebook()
       {
            $this->load->library('fb_connect');      
            $param = array( 
                            'scope' =>'email,user_location,user_birthday,offline_access',                                                   'redirect_uri' => base_url()
                           );
            redirect($this->fb_connect->getLoginUrl($param));                   
    
       }
    
       function facebook()
       {    
    
            if (!$this->fb_connect->user_id) {      
    
            } else {        
                $fb_uid = $this->fb_connect->user_id;
                $fb_usr = $this->fb_connect->user;  
                $firstname = $fb_usr['first_name'];
       }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm with some problems implementing my first application with Login with Facebook. The user
I am currently implementing Facebook Login on my website for the first time and
We're implementing a Facebook-connect mechanism to allow users to sign up into our system.
I am implementing a facebook connect based application, and when I use $facebook->require_login() I
Implementing a PhoneGap app for Android and iOS, the app is using Facebook Connect
Good afternoon. i am working on implementing the facebook like box into website. i
I am implementing site with login via facebook. I call FormsAuthentication.SetAuthCookie(response.email, true); after facebook
I'm having trouble implementing the Facebook SDK in an iOS project and I suspect
I'm having trouble implementing the Facebook SDK in an iOS project. I am trying
I'm having a problem implementing the feed dialog function of Facebook within my canvas

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.