I am not able to login using FB in any of the applications. usually the URL should be
https://www.facebook.com/login.php?skip_api_login=1&api_key=XXX....
But in my case :
https://www./login.php?skip_api_login=1&api_key=XXX.. (without "facebook.com")
Here's the code :
<?php
require 'facebook.php';
$facebook = new Facebook(array(
'appId' => '137737616434442',
'secret' => 'XXX',
'baseurl' => 'http://localhost/facebookconnect/login/example.php',
));
$user = $facebook->getUser();
if ($user) {
try {
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
if ($user) {
$logoutUrl = $facebook->getLogoutUrl(array( 'next' => 'http://localhost/facebookconnect/login/example.php' ));
session_destroy();
} else {
$loginUrl = $facebook->getLoginUrl(array(
'scope' => 'email,user_birthday,friends_birthday,publish_stream,user_location,friends_location,user_work_history,user_likes,friends_work_history,user_about_me,friends_about_me,user_hometown',
'redirect_uri' => 'http://localhost/facebookconnect/login/example.php'));
}
$naitik = $facebook->api('/naitik');
?>
I tried this basic Facebook code but it didn't work. Can someone help me with this issue?