Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- try{
- include_once "./lib/facebook.php";
- }catch(Exception $o){
- echo '<pre>';
- print_r($o);
- echo '</pre>';
- }
- $facebook = new Facebook(array(
- 'appId' => $appid, //kontrol et buraları
- 'secret' => $secret, //kontrol et buraları
- 'cookie' => true
- ));
- $session = $facebook->getSession();
- $loginUrl = $facebook->getLoginUrl(
- array(
- 'canvas' => 1,
- 'fbconnect' => 0,
- 'req_perms' => 'email,publish_stream,user_photos,user_photo_video_tags,friends_photos,friends_photo_video_tags' //user_relationships,friends_relationships,user_relationship_details,friends_relationship_details
- )
- );
- if (!$session){
- echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
- exit;
- }else{
- try {
- $uid = $facebook->getUser();
- $fbme = $facebook->api('/me?fields=id,first_name,last_name,picture,name,gender,email');
- }catch(FacebookApiException $e){
- echo "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
- exit;
- }
- }
- print_r($fbme);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement