Facebook Login PHP

Jel ima neko neku PHP skriptu za facebook login, da valja?
Ja koristim ovu i nece pa nece:

require_once("fb/facebook.php");

   $config = array(
      'appId' => '328850757240197',
      'secret' => '788f5992d8802e0bcf63d320d9995f4c',
      'fileUpload' => false, // optional
      'allowSignedRequest' => false, // optional, but should be set to false for non-canvas apps
  );

  $facebook = new Facebook($config);
  $user_id = $facebook->getUser();
  if($user_id) {
    
         try {
    
            $user_profile = $facebook->api('/me');
            echo "<pre>";
            print_r($user_profile);
            echo "</pre>";
    
          } catch(FacebookApiException $e) {
            // If the user is logged out, you can have a 
            // user ID even though the access token is invalid.
            // In this case, we'll get an exception, so we'll
            // just ask the user to login again here.
            $login_url = $facebook->getLoginUrl(); 
            echo 'Please <a href="' . $login_url . '">login.</a>';
            error_log($e->getType());
            error_log($e->getMessage());
          }   
    } else {
          // No user, print a link for the user to login
          $login_url = $facebook->getLoginUrl();
          echo 'No Log. Please <a href="' . $login_url . '">login.</a>';

    }
?>

Sajt je www.shimi.bl.ee/test1
I aplikacija je napravljena - http://prntscr.com/3krjtv

Zna li neko sta radim lose?


Copyright © 2020 WM Forum - AboutContact - Sponsored by: Mydataknox & Profit Monkey