未定义的索引:facebook api中的操作错误

时间:2014-02-05 18:17:02

标签: facebook-graph-api wamp facebook-php-sdk

我在我的网站上使用php api(制作个人资料页面)

我使用以下代码:

$action = $_REQUEST["action"];
switch($action){
case "fblogin":
include 'facebook.php';
$appid  = "**********";
$appsecret  = "*************************";
$facebook   = new Facebook(array(
'appId' => $appid,
'secret' => $appsecret,
'cookie' => TRUE,
));
$fbuser = $facebook->getUser();
if ($fbuser) {
try {
$user_profile = $facebook->api('/me');
}
catch (Exception $e) {
echo $e->getMessage();
exit();
}
$user_fbid  = $fbuser;
$user_email = $user_profile["email"];
$user_fnmae = $user_profile["first_name"];
$user_image = "https://graph.facebook.com/".$user_fbid."/picture?type=large";
$check_select = mysql_num_rows(mysql_query("SELECT * FROM `fblogin` WHERE email =      '$user_email'"));
if($check_select > 0){
mysql_query("INSERT INTO `fblogin` (fb_id, name, email, image, postdate) VALUES  ('$user_fbid', '$user_fnmae', '$user_email', '$user_image', '$now')");
}
}
break;
}

它提示错误:未定义索引:操作 我使用wamp服务器作为localhost。请提供解决方案

0 个答案:

没有答案