tags:

views:

30

answers:

1

I am trying to retrieve user email via facebook after user authentication on my website.

I ran the query below, but the email and birthday fields are empty ; and they are very vital for registration on my website.

#*** run fql ***
   $fql    =   "select uid, first_name, last_name, name, sex, email, current_location, website, interests, birthday, pic_big from user where uid=me()";
   $param  =   array('method' => 'fql.query', 'query' => $fql, 'callback' => '');
   $user   =   $facebook->api($param);print_r($user);

What do i do please

+2  A: 

To access fields like email and birthday you need to request extra permissions during authorization. Full list of permissions is available here.

serg
pls i have gone thru it , i cant seem to understand ow to use the extended permission, pls can you help with a sample, will be glad thanks
Ogugua Belonwu
you can just ask for permissions when logging in: $facebook->login('permission1, permission2...')
Claudiu
@Ogugua: Here is what seems like a decent tutorial: http://net.tutsplus.com/tutorials/php/how-to-authenticate-your-users-with-facebook-connect/
serg