简体   繁体   English

如何将URL重定向到父iframe

[英]How to redirect an URL to a parent iframe

Im trying to redirect an user of my page when I ban him from my chat box using this (php): 当我使用这个(php)禁止他从我的聊天框中禁用他时,我试图重定向我的页面的用户:

header("location: index.php");
exit;

The problem is the index.php page is opening inside the connected users section, in this case inside a div . 问题是index.php页面在连接用户部分内部打开,在这种情况下在div内部。 How can i redirect the user's main page ? 如何重定向用户的主页面?

Thanks for your time. 谢谢你的时间。

在javascript代码中尝试这个:

window.top.location.href = "http://www.site.com";

这是使用javascript的答案:

window.parent.location = "http://www.example.com/index.php";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM