1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<?php session_start();
require_once './Facebook/autoload.php'; // change path as needed
$fb = new Facebook\Facebook([ 'app_id' => '602480853631841', // Replace {app-id} with your app id 'app_secret' => '088fea3298ed3b7c4ace6c9b6be0d32f', 'default_graph_version' => 'v3.2', ]);
$helper = $fb->getRedirectLoginHelper();
$permissions = ['email']; // Optional permissions $loginUrl = $helper->getLoginUrl('https://mjsoft.co/2.php', $permissions);
echo '<a href="' . htmlspecialchars($loginUrl) . '" target="_blank">Log in with Facebook!</a>';
?>
|