Skip to main content
Inspiring
August 13, 2010
Question

Facebook application: user identification

  • August 13, 2010
  • 1 reply
  • 551 views

<?php
require_once '../common/facebook.php';
$appapikey = 'eff48960c4b2c6ede8096fd99eae2215';
$appsecret = '60dd4e4368ea026102e77c29bf4a721a';
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();
include 'connection.php';  

?>

This code used to work, but since the API changes, this line seems to be the problem:

$user_id = $facebook->require_login();

If I delete it, the app runs, but doesn't recognize the Facebook user. So I think I need the correct syntax. Any suggestions will be very much appreciated.

This topic has been closed for replies.

1 reply

sbudlongAuthor
Inspiring
August 13, 2010

After some Googling, I'm thinking that I need a way to assign the Facebook UID to the PHP variable #user_id. Can anyone suggest how to do this?

sbudlongAuthor
Inspiring
August 14, 2010

uid = $facebook->getUser(); is supposed to be the answer, but it doesn't return the UID for some reason in this app. I read that this $user_id = $facebook->require_login(); has been replaced in the new Graph API.