PHP“标题(位置)”在IFRAME中,加载_top位置? [英] PHP "header (location)" inside IFRAME, to load in _top location?

查看:126
本文介绍了PHP“标题(位置)”在IFRAME中,加载_top位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在IFRAME里面的简单表单。当用户点击SUBMIT时,它会重定向到我服务器上的特定页面。我用于重定向的函数是

$ $ $ $ $ $ c $ header>'Location:mypage2.html');
exit();

但我希望新页面在_top位置打开,而不是在我使用的相同IFRAME内。我怎样才能让浏览器在_top中打开新页面而不是在IFRAME中?
在此先感谢。

解决方案

您无法在PHP中达到预期效果。这是您必须从JavaScript执行或将目标属性添加到< form>

 < form ... target =_ top> 


I have a simple form which is inside IFRAME. When user click on SUBMIT, it redirects to a specific page on my server. The function I use for the redirect is

 header ('Location: mypage2.html');
exit ();

But I want the new page to open in _top location, not inside the same IFRAME that I use. How can I tell the browser to open the new page in _top not inside the IFRAME? Thanks in advance.

解决方案

You are not able to achieve the desired effect in PHP. This is something you'd have to do from JavaScript or add target attribute to <form>:

<form ... target="_top">

这篇关于PHP“标题(位置)”在IFRAME中,加载_top位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆