Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I tried to add Facebook credential to my website. But except name and Facebook ID, other details are not returned.

include_once("includes/access_login.php");
include_once("facebook/facebook.php");
define('YOUR_APP_ID', '16604785137509701');


$facebook = new Facebook(array(
'appId' => '16607854137509701',
'secret' => '5cfdea08254bb6637d064924a73e5c508',
));

$userId = $facebook->getUser();

echo "FB User Id : " . $userId;

$userInfo = $facebook->api('/me');

echo "
";
    print_r($userInfo);
    echo "
";

?>

enter image description here

C#
I have used these things. I am getting

FB User Id : 902204443331431759

Array
(
    [name] => sradha
    [id] => 902204443331431759
)

but not the other details. Suggest me
Posted
Comments
Philippe Mori 3-Feb-16 13:06pm    
I hope that facebook do not allows to retreive such information as email is generally confidential.

Don't you think that this question would be better asked in a forum dedicated to Facebook development? Like this one[^]?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900