开发者

redirect user to login page without using fbml on facebook page

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜