How to read the birthday_date from the Facebook API
Posted
by
Steve
on Stack Overflow
See other posts from Stack Overflow
or by Steve
Published on 2010-12-30T20:49:59Z
Indexed on
2010/12/30
20:54 UTC
Read the original article
Hit count: 212
I have been chasing my tail on this! And it should be so simple!!
I have an app in FaceBook that is working fine. However, I need to get the user's birth date. I have successfully got the request for extended permissions, but cannot get the birthday_date out and into a variable/store in database.
<?php
require_once('facebook.php');
$facebook = new Facebook(array(
'appId' => 'xxxxx',
'secret' => 'yyyyyyy',
'cookie' => true
));
if ($facebook->getSession()) {
$uid = $facebook->getUser();
$fbme = $facebook->api('/me');
} else {
$params = array(
'fbconnect'=>0,
'canvas'=>1,
'req_perms'=>'publish_stream','email','user_location','user_birthday'
);
$loginUrl = $facebook->getLoginUrl($params);
print "<script type='text/javascript'>top.location.href = '$loginUrl';</script>";
}
$session = $facebook->getSession();
$token = $session['access_token'];
I would be very grateful if someone could show me the PHP code that reads the extended permissions and places the results into variables.
Thanks Steve
© Stack Overflow or respective owner