Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require '../fb/facebook.php';
- $facebook = new Facebook(array(
- 'appId' => '***',
- 'secret' => '***'
- ));
- // Get User ID
- $fbUser = $facebook->getUser();
- if(!$fbUser)
- {
- $loginUrl = $facebook->getLoginUrl(
- array('scope' => 'email')
- );
- }
- try {
- $user_profile = $facebook->api('/me');
- } catch (FacebookApiException $e) {
- echo '<pre>'.htmlspecialchars(print_r($e, true)).'</pre>';
- $user = null;
- }
- ?>
- <br /><br />
- <a href="<?=$loginUrl?>">login</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement