100分邀请高手解决:表单提交后,用js的goback后退后内容全没了

tryc tryc 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
表单提交后,用js的goback后退后内容全没了。
找了N多文章,没找到原因。

我加了个头,在firefox中可以后退了,在IE6、7、8中仍然不可以。
我加的header如下:
@header ( 'Cache-Control: store, no-cache, must-revalidate' );

哪位能解决的,一百分全送。当前只给了十分,怕没人能解决,浪费了,解决了一定加分送上

别告诉我什么在当前页面验证。绕过去的方法很多,我只想解决这个问题,不想绕过去!!!

有兴趣的可以下载下面页面去试试。


我把页面内容也贴出来吧:
---------------------a.php------------------------------
<?php
session_start();
$_SESSION['aaa'] = "aaaaaaaaaaaa";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="b.php">
<input type="text" name="textfield" id="textfield" />
<input type="submit" name="button" id="button" value="Submit" />
</form>
</body>
</html>
---------------------b.php------------------------------
<?php session_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
window.onload = function() {
alert("go back <?=$_SESSION['aaa']?>");
window.history.go(-1);
}
</script>
</head>

<body>
</body>
</html>
...全文

相关推荐

评论 23
收藏 已收藏
分享
返回顶部
tryc
基础编程 21,889 成员 140,329 内容