I'm a novice when it comes to java and not awesome at php, so dont judge me if this is realy easy or impossible...
I would like to extract the users facebook-id and put it into a php-variable. How do i do that?
The code im using is from a facebook tutorial video, and its working. I just want to be able to use the user id in a php code.
This is my code:
<form action="" method="post">
<div id="user">
Name: <input name="name" size="27" /><br />
<fb:login-button length="long" onlogin="update_user_box();"></fb:login-button>
</div>
<textarea name="comment" cols="30" rows="5"></textarea><br />
<input type="submit" value="Submit comment" />
</form>
<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script>
<script type="text/javascript">
function update_user_box() {
var user_box = document.getElementById("user");
user_box.innerHTML =
"<span>"
+"<fb:profile-pic uid='loggedinuser'></fb:profile-pic>"
+"Welcome, <fb:name uid='loggedinuser' useyou='false'></fb:name>. "
+"You are signed in with your Facebook account."
+"<fb:uid uid='loggedinuser'></fb:uid>"
+"<a href='#' onclick='FB.Connect.logout(function() { reload(); }); return false;' ><img id='fb_logout_image' src='http://static.ak.fbcdn.net/images/fbconnect/logout-buttons/logout_small.gif' border='0' alt='Connect'/></a>"
+"</span>";
FB.XFBML.Host.parseDomTree();
}
FB.init("API-KEY","xd_receiver.htm");
FB.ensureInit ( function () {
FB.Connect.ifUserConnected(update_user_box);
});
</script>