, 나는이 코드를 구축 다른 ID를 줘 :로그인, 페이스 북은
<?php
ob_start();
include("facebook_constants.php"); // in this file i have appid and appsecretid
$users = $facebook->getUser();
if ($users!="") {
try {
$user_profile = $facebook->api('/me','GET');
$logoutUrl = $facebook->getLogoutUrl();
$fuserid=$user_profile["id"]; // give me the id of the user
$fusername=$user_profile["name"]; // give me the name of the user
$femail=$user_profile["email"]; // give me the email of the user
$fusernamenew = str_replace(' ', '', $fusername); // change the name to username (omer lol = omerlol)
$newtoken=base64_encode($fuserid."::".$fusernamenew."::".$femail); // data to token
$itsme = $this->haimz->DB->num_rows("SELECT id FROM users WHERE fbid = ?haimz?", $fuserid); // if have user with that id = login , if not goto register page
if($itsme > 0){
echo "goto login page";
}
else{
echo "goto register page";
exit;
}
} catch (FacebookApiException $e) {
$users = null;
}
}
?>
은 $ fuserid 나에게 다른 사용자 ID를 제공하지만 $의 fusername 및 $ 나에게주는 femail 맞다. 사용자의 사용자 ID가 아닙니다. 다른 사용자 ID.
확인. 고맙습니다! 하지만 어떻게 허가를 요청할 수 있습니까 ?? –
무슨 허가? 더 이상 "진짜"ID를 얻을 수있는 방법이 없습니다. – luschn