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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:15:02+00:00 2026-05-24T09:15:02+00:00

I have this code to log people in with Facebook: <div id=fb-root></div><script src=http://connect.facebook.net/en_US/all.js#appId=my_app_id&amp;xfbml=1> </script><fb:login-button

  • 0

I have this code to log people in with Facebook:

<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=my_app_id&amp;xfbml=1">
</script><fb:login-button show-faces="false" perms="user_hometown,user_about_me,email,user_address" autologoutlink="true" width="200" max-rows="1">
</fb:login-button>

<?php

if($facebook->getSession())
{
 // Nothing here yet
}

?>

But the call to $facebook->getSession() seems to break the page. Nothing below this call gets displayed. Any idea why? Or what I am doing wrong?

Here is the page where I am trying to test this:
http://www.comehike.com/test_fb_connect.php

  • 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-24T09:15:03+00:00Added an answer on May 24, 2026 at 9:15 am

    If that’s your entire PHP file then your referencing $facebook which hasn’t been declared yet. You’ll want to include the location of the PHP SDK then initialize $facebook with your appID and secret. This format has changed with v3.0.0 of the PHP SDK found here.

    V 2.2.X

    require '../src/facebook.php';
    
    $facebook = new Facebook(array(
          'appId'  => '12345678910',
          'secret' => '*****************************',
        ));
    
    $session = $facebook->getSession();
    if ($session) {
      // proceed knowing you have a valid user session
    } else {
      // proceed knowing you require user login and/or authentication
    }
    

    V 3.0.0

    require '../src/facebook.php';
    
    $facebook = new Facebook(array(
      'appId'  => '12345678910',
      'secret' => '*****************************',
    ));
    
    $user = $facebook->getUser();
    if ($user) {
      // proceed knowing you have a logged in user who's authenticated
    } else {
      // proceed knowing you require user login and/or authentication
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this code: <!DOCTYPE HTML> <html> <head> <script src=http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js type=text/javascript djConfig=parseOnLoad: true></script> <script
I have this code.. String you = buf.readLine(); Log.d(STRING, ikaw); StringTokenizer st = new
I have this code , and I want to run Log.d every 1000 milis
I have the following code: Log.e(MainScreen, 1); ListAction listAction = new ListAction(this); Log.e(MainScreen, 2);
Consider this JavaScript code snippet: Object.prototype.log = function() { // here, you have a
this is my code and have a error: $('#map_canvas').mouseover(function(e){ console.log(e.offset().left+' '+e.offset().top) }) thanks i
I have this code that throws a math domain error exception: v = -1.0
I have this code, the idea is to read from a file and the
i have this code preg_match_all('%(?:youtube\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^&?/ ]{11})%i', $asd, $match); to find youtube key of urls
I have this code to get the local date/time. It works but it seems

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.