Facebook登录未重定向 [英] Facebook login not redirecting

查看:99
本文介绍了Facebook登录未重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么以下各项不起作用?

Why is the following not working?

// Login or logout url will be needed depending on current user state.
if ($user) {

    $logoutUrl = $facebook->getLogoutUrl();

} else {

    $loginUrl = $facebook->getLoginUrl();
    header("Location: ".$login_url);

}

使用xdebug,我可以看到它正在通过else部分,但是当到达文件末尾时,它将停留在当前页面上,而不是打开新的login_url页面,该页面应显示Facebook登录屏幕.

Using xdebug, I can see that it is going through the else section, but when it gets to the end of the file, it stays on the current page, instead of opening the new login_url page which should show the facebook login screen.

有人知道为什么不去Facebook页面吗?

Anyone know why it's not going to the facebook page?

推荐答案

找出了问题所在.我有一个错字...我正在将网址分配给$logoutUrl,并试图从$logout_url ...

Figured out the problem. I had a typo... I was assigning the url to $logoutUrl and was trying to get the url from $logout_url...

谢谢

这篇关于Facebook登录未重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆