php - why my page wont get my facebook name? -
<?php require_once('facebook.php'); // require 'facebook.php'; $facebook = new facebook(array( 'appid' => 'my_appid', 'secret' => 'my_secret' )); if($facebook->getuser() == 0){ $login_url = $facebook->getloginurl(array( 'scope' => 'email' )); echo "<a href = '$login_url'>login facebook</a>"; } else{ $api = $facebook->api('/me','get'); echo "hi " . $api[name]; echo "<br><a href ='logout.php'>logout</a>"; }; ?>
i think have facebook sdk 3.2.3 working somehow keep return logging page , when click log in facebook , facebook ask me wanted pass data on , when redirect url cant echo name , wrong ? getuser keep return = 0 ?
can me take ? wanted use 4.0 sdk friend sever 5.2 below need facebook loging working. doing wrong here?
try :
echo "hi " . $api['name'];
this work.
Comments
Post a Comment