【问题标题】:Facebook tab redirect with header('location:'.$url); [closed]Facebook 选项卡重定向与 header('location:'.$url); [关闭]
【发布时间】:2013-11-10 18:40:31
【问题描述】:

我正在为 facebook 开发一个应用程序选项卡。理论上我想在粉丝和非粉丝之间创建一个重定向(经典的 fangate)......但我对数据库没有任何问题!

----- First example, work only with HTTPS and not HTTP :/
$fan = 'https://website.com/fan.html'; 
$nofan = 'https://website.com/nofan.html';

----- Second example i get it form database and doesn't work :@
$fan = $app_data[5]; //if I print this > https://website.com/fan.html
$nofan = $app_data[6]; //if I print this > https://website.com/nofan.html

然后我把它放进去:

if (1<2) {
echo header( "Location:".$fan); exit;}
else { 
echo header( "Location:".$nofan); exit;} 

感谢您的关注。我希望我解释得很好,期待建议..

已解决:如您所见 > http://jsfiddle.net/x2F8s/1/ 基于 php 标头位置的重定向在 iframe 内不起作用 O.o STRANGE :O

【问题讨论】:

标签: php mysql facebook api redirect


【解决方案1】:

你应该试试这个

if (1<2) {
 header( "Location: ".$fan.""); die();}
else { 
header( "Location: ".$nofan); die();} 

【讨论】:

  • 适合您吗?或仍需要帮助
  • 它可以在普通浏览器中使用,但不能在 facebook 中使用...我正在做一些测试。
  • 因为它可能需要身份验证才能到达那里。
  • jsfiddle.net/x2F8s 问题在于 iframe 重定向支持..
  • 嗨...有一个例子:jsfiddle.net/x2F8s/1
猜你喜欢
  • 2017-08-13
  • 1970-01-01
  • 2011-11-18
  • 1970-01-01
  • 2017-10-14
  • 1970-01-01
  • 1970-01-01
  • 2022-01-16
  • 2011-12-17
相关资源
最近更新 更多