提交后是否有任何重定向Facebook粉丝页面的解决方案

时间:2014-01-31 14:45:24

标签: javascript php facebook

在我的Facebook应用程序中,我只需输入我的网站表单即可输入数据。提交表单后,它显示成功消息。现在我想将它重定向到我的Facebok粉丝页面。但我不能。我使用了几种方法,但我会发疯:(

<?php
echo "<div class='success'><font color='green' size='5'>Congratulation!. Successfully submited your recipe. Thank You.</font/></center></div>";
//header("Refresh:5; url=fan_page_url");
//echo "top.location.href='fan_page_url'";
//header("Refresh: 1;");
//header("Location: fan_page_url");
?>
<script type='text/javascript'>
window.location.href = 'fan_page_url';
</script>

2 个答案:

答案 0 :(得分:0)

您可能需要这样做

<script type='text/javascript'>
    window.top.location = 'http://www.facebook.com/fanapage';
 </script>

答案 1 :(得分:0)

如果我只是将它运行到localhost就可以了,试试看。

<?php
echo "<div class='success'><font color='green' size='5'>Congratulation!. Successfully submited your recipe. Thank You.</font/></center></div>";
//header("Refresh:5; url=fan_page_url");
//echo "top.location.href='fan_page_url'";
//header("Refresh: 1;");
//header("Location: fan_page_url");
?>
<script type='text/javascript'>
window.location.href = "https://www.facebook.com/jQuery";
</script>