开发者

redirect user to login page without using fbml on facebook page

开发者 https://www.devze.com 2023-01-08 17:48 出处:网络
so i\'m creating a login_url using php framework and getLoginUrl(). if my facebook app is setted as an FBML page, something like this works fine

so i'm creating a login_url using php framework and getLoginUrl().

if my facebook app is setted as an FBML page, something like this works fine

echo '<fb:redirect url="'.$login_url.'" />';

but i need my facebook application configured as an IFRAME page, so it will not开发者_JAVA百科 be rendered as FBML.

whats the best way to redirect my user to the login page?

using header(); in php will not work, because header is already sent. also

echo '<script type="text/javascript"> document.setLocation("'.$login_url.'"); </script>';

has no effect.

any ideas?


at the moment

echo '<script type="text/javascript"> top.location.href = "'.$login_url.'"; </script>';

is working. but i think its not a very clean solution. i'll accept another answer if somebody has a better way.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号