Facebook get email and name
I'm making a facebook app and I made a great progress but stuck! I made an app in which it requires "Your basic info" and "Your e-mail address". If someone accepts the app use, I have the code that I can get
- user locale
- user country
- and user oauth_token
It seems that I don't really know how to retrieve the name (first_name and last name) and other details. YES I can see all my details in a link like below
but I don't know how to store in a php variable the values. Can anyone help??? The only things I want to do, is retrieve the name and email of users who accept the app (through the canvas page) and post somthing to their wall if they answer a few questions.
Small paypal tip for the first one who helps!
(edit: there are some examples that are using the php sdk - have tried all of them, but nothing works!!!! This also doesn't work: )
Last edited by webdeveloper83; 04-09-2012 at 01:42 AM.
Solution found. For those who understand facebook development, you can do this by using the json_decode
$graph = json_decode(file_get_contents("https://graph.facebook.com/".$code));
And then get values to php variables:
$id = $graph->id;
$name = $graph->first_name ;
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread