How to read the birthday_date from the Facebook API
- by Steve
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