dos3018 2010-07-21 08:32
浏览 39
已采纳

在Facebook页面上不使用fbml将用户重定向到登录页面

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 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?

  • 写回答

1条回答 默认 最新

  • duanbanfei2875 2010-07-21 10:21
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分