【发布时间】:2013-05-21 11:42:49
【问题描述】:
我很想知道为什么以下内容在 Firefox 21 和 Chrome 26 中不起作用,但在 IE 6 中起作用。
我有一个包含 iframe 的页面“frame.html”。
iframe 指向另一个页面“post.html”。
post.html 包含一个将用户名 POST 到服务器 php 页面“redirect.php”的表单。
服务器以重定向到谷歌的方式响应。
在 IE6 中,Google 页面出现在 iframe 中,但在 Firefox 和 Chrome 中却没有。
有谁知道为什么会发生这种情况,以及在现代浏览器中是否有可能?
谢谢。
frame.html
<html>
<head>
<title>Frame</title>
</head>
<body>
<iframe width="800" height="800" src="post.html"/></iframe>
</body>
</html>
post.html
<html>
<head>
<title>Post</title>
</head>
<body>
<form action="http://myserver.com/redirect.php" method="post">
<input type="text" name="username"/>
<input type="submit" value="Send"/>
</form>
</body>
</html>
redirect.php
<?php header('Location: http://www.google.com'); exit; ?>
【问题讨论】:
标签: php html http redirect iframe