Holen Sie sich facebook-Benutzer-info über PHP

in diesem einfachen php-Datei: (http://gist.github.com/273402)

<?php
session_start();
include_once 'libraries/facebook/facebook.php';

//$fb_user=$facebook->get_loggedin_user();
?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"></script>
<script type="text/javascript">
    FB.init("PUBLIC_KEY", "http://localhost/xd_receiver.htm",{"reloadIfSessionStateChanged":true});
</script>
</head>
<body>
<h1>User index</h1>
<fb:login-button onlogin="window.location.reload(true)"></fb:login-button>
<fb:profile-pic uid="loggedinuser" size="square" facebook-logo="true"></fb:profile-pic>
<?php
$facebook = new Facebook("PUBLIC_KEY","SECRET");
    if($facebook->get_loggedin_user()){
      echo "logged";
    } else {
      echo "not-logged";
    };

    ?>
</body>
</html>

kann ich nicht bekommen $facebook->get_loggedin_user(), aber FBXML tun, machen die Profil-pic, warum?

wie bekomme ich die Benutzer-info in PHP, nicht in JS?

InformationsquelleAutor joetsuihk | 2010-01-10
Schreibe einen Kommentar