Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在使用iframe时重定向onclick_Php_Html_Iframe - Fatal编程技术网

Php 如何在使用iframe时重定向onclick

Php 如何在使用iframe时重定向onclick,php,html,iframe,Php,Html,Iframe,在操作完成之前,我必须使用iframe来阻止页面重新加载。但是,我需要在操作发生后刷新它。为此,我尝试了两种方法:刷新页面和重定向到同一页面 PHP: HTML: <iframe width="0" height="0" border="0px solid white" style="display:none" name="iframe1" id="iframe1"></iframe> <form action="index.php" method

在操作完成之前,我必须使用iframe来阻止页面重新加载。但是,我需要在操作发生后刷新它。为此,我尝试了两种方法:刷新页面和重定向到同一页面

PHP:

HTML:

<iframe width="0" height="0" border="0px solid white" style="display:none" name="iframe1" id="iframe1"></iframe>

        <form action="index.php" method="post" target="iframe1">
         <input type="submit" href="" style="margin-top:5px" name="btn_name" class="btn btn-success" value="Enter">
            </form>


谢谢你的帮助。所有的意见都很感谢

$\u POST['btn']
不发布任何内容,因为它是一个类


尝试
$\u POST['installer4\u btn']

尝试将此添加到您的iframe所在的页面中(使用jquery)

$('#iframe1').load(function(){
如果(this.contentWindow.location.href=='http://location_redirected_in_php') {
window.location.href='/redirect_location';
}

});

这实际上会在iframe重新加载时向其添加一个侦听器,因此如果在成功提交或使用php处理后重新加载页面,则只需获取它将结束的位置并检查它,如果iframe具有该url,则重新加载父页面。为了更好地衡量,它应该是“header”(“location:index.php”)`
<iframe width="0" height="0" border="0px solid white" style="display:none" name="iframe1" id="iframe1"></iframe>

        <form action="index.php" method="post" target="iframe1">
         <input type="submit" href="" style="margin-top:5px" name="btn_name" class="btn btn-success" value="Enter">
            </form>