I have created a simple Facebook application in PHP, that greets user by there user name, I also want there Email id, to be displayed. But i am not able to do that. the code that i am using is,
require_once('facebook.php');
require_once('config.php');
$facebook = new Facebook(APIKEY, SECRETKEY);
$user=$facebook->require_login();
echo $user; // displaying the ID
<div style="padding: 10px;" id="greeting">
<fb:if-is-app-user uid="loggedinuser">
<h2>Hi <fb:name firstnameonly="true" uid="loggedinuser" useyou="false"/>! welcome to facebook</h2>
<fb:else>
<h2>Hi <fb:name firstnameonly="true" uid="loggedinuser" useyou="false"/>! welcome to facebook</h2>
</fb:else>
</fb:if-user-has-added-app>
</div>
the Output that i am getting is,
1000002020202020
Hi User! welcome to facebook
I want the Email address to be displayed along with the user name, i searched many code but did not get any solution. and if you any good facebook tutorial site please post the links too..