Facebook 0, .
, , , facebook .
, . , , .
, . , . "" HTML JSFBSDK , , , (, ..)
require_once realpath(dirname(__FILE__)) . 'facebook.php';
$current_url = '';
$facebook = new Facebook(array(
'appId' => '',
'secret' => '',
));
$fbCurrentUserID = $facebook->getUser();
if (!$fbCurrentUserID){
$loginUrl = $facebook->getLoginUrl(array(
'scope' => 'email, publish_actions',
'redirect_uri' => $current_url,
));
die(header('Location: ' . $loginUrl));
}
try {
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
die(header('Location: /'));
}