我正在实现3D安全。它要求在iframe内自动提交一个表单,这样响应就可以在所述iframe中显示银行用户名/密码框。
<form id="3D_form" target="3D_iframe" action="<?php echo $acsurl; ?>" method="post">
<input type="hidden" name="PaReq" value="<?php echo $pareq; ?>" />
<input type="hidden" name="MD" value="<?php echo $md; ?>" />
<input type="hidden" name="TermUrl" value="<?php echo $termurl; ?>" />
</form>
<iframe name="3D_iframe" width="100%" height="400" frameborder="0" src="<?php echo $acsurl; ?>"></iframe>
一旦用户输入了他们的用户名/密码,成功代码就会发布到我也提供给原始iframe帖子的URL(TermUrl)。
问题是,TermUrl在iframe中呈现了一个带有我的网站主题/模板的页面,所以我在页面中获得了一个页面,如果这有意义的话?
我在用Joomla。My TermUrl是控制器中的一个函数,如:
http://www.mywebsite.com/index.php?option=com_mycontroller&task=mycontroller.callback
你知道我如何在iframe中呈现一个空白网页,或者更好的是,在没有iframe的情况下重新呈现整个页面。。。?目前,我必须使用回调函数中的Javascript重新加载页面:
function callback() {
echo "<!DOCTYPE html>";
echo "<head>";
echo "<title>Form submitted</title>";
echo "<script type='text/javascript'>window.parent.location = 'http://mywebsite.com/index.php?option=com_mycontroller&view=myview'</script>";
echo "</head>";
echo "<body></body></html>";
}
在控制器中的函数末尾添加die;
。我想这会成功的,不会打开Iframe in和Iframe