页面回退,表单内容被清空的问题。。急!!!120分 代码的开始有没有输出?header 什么的,session什么的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-control: private"); to:回复人: qinzx121(东郭后生) 你的方法不行的 点击返回输出页面是个按钮吧,用window.history.back()试试看 回复人: Abstract(抽象派) 点击返回的是一个输出页面上的按钮,我用sefl.history.go(-1);和window.history.back();结果都是一样的还是不行主要问题在于,我在表单提交的页面里点击了弹出窗口后,关闭弹出窗口,然后提交表单。返回时就发现页面被reset了 to: flyonet(人生如梦【★】梦如人生) 我去掉Header后,还是不行 test.asp:<%dim showshow=trueif request.Form("txt")<>"" then response.Write "error" : show=false%><html><head></head><body><div <%if not show then%> style="visibility:hidden" <% end if%>><form action="" method=post ><input type=text value="<%=request.Form("txt")%>" name=txt><input type=button onclick="window.open('test1.asp')" value="open"><input type=submit></form></div></body></html>test1.asp:<html><head></head><body><input type=text value="" name=txt><input type=button onclick="opener.document.all.txt.value=txt.value;window.close()"></body></html> 楼上的用一个response.end不就可以不显示下面的内容吗?干吗弄得那么复杂?还是没有解决我的问题啊 记得上次讨论过的,不知道是不是用session_cache_limiter('private');。 http://msdn.microsoft.com/workshop/author/persistence/persistence_ovw_entry.asp IE设置的问题,工具-〉Internet选项-〉常规-〉Internet临时文件-〉设置-〉不检查如果是自动的话,返回用history.back(-1)试试看。因为你返回的时候缓存已经清除掉了,就没了。不检查应该就不会清除了。 #避免网页过期ob_start(); if(function_exists(session_cache_limiter)){ session_cache_limiter("private, must-revalidate"); } 可以采用iframe的做法。//biaodan.php<form action="save.php" method="post" target="myFrame"><textarea name="content">表单内容了</textarea><input type="submit" value="提交"></form><iframe id="myFrame" width="0" height="0" frameborder="0"></iframe>//save.php<?if ($content==""){echo"<script language='JavaScript'>";echo "alert(\"请输入内容\")";echo "</script>";die();}?> 如果你使用的是java开发,建议使用struts的formbean,可以保存数据 大家看看下面这段程序,Text1输入空,Text2输入一些文字。点击Submit后,打印出错信息,然后点击back按钮返回表单页面,Text2的内容没有被清空但是当我在Text2输入一些文字后,点击了旁边的open按钮,(test.htm文件可以是空白页面,或者不存在)。然后再点击submit按钮。在提示出错后,点击返回按钮,这是Text2的内容就被清空了。大家帮我看看怎么回事啊<?if (isset($submit)){ if ("" == trim($txtIn)) { echo "error<br>"; ?> <input type="button" value="back" onClick="history.go(-1);"> <? exit; }}?><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>test</title></head><body><center><form action="test.php" method="get" name="f">Text1<input type="text" name="txtIn"> <br>Text2<input type="text" name="txtIn2"> <input type="button" onClick="window.open('test.htm','test')" value="open"><br><input type="submit" value="submit" name="submit"></form></center></body></html> 绝对行:ob_start();session_cache_limiter('private'); To:pswdf(小邪) ( ) 信誉:100你将你说的代码加到里面去看看是否可行?我试过了,还是不行! to:回复人: dhlxmy() ( ) 信誉:97 要提交好多内容的啊能否有更省事的方法? <HTML><HEAD><META NAME="save" CONTENT="history"><STYLE> .sSnapshot {behavior:url(#default#savesnapshot);}</STYLE></HEAD><BODY><INPUT class=sSnapshot type=text id=oPersistInput></BODY></HTML> <HTML><HEAD><META NAME="save" CONTENT="history"><STYLE> .saveHistory { behavior:url(#default#savehistory); }</STYLE></HEAD><BODY>加了历史保留功能:<br><textarea class=saveHistory></textarea><br>没有加的:<br><textarea></textarea><p><input type=button onclick='javascript:location.href="http://www.163.com"' value='点击进入,再按后退键试试?'></BODY></HTML> 绝对行:(两个一起来)ob_start();header("Cache-control: private");session_cache_limiter('private'); 行了,就是少了个<META NAME="save" CONTENT="history">的原因。 关于uchome中space.php 介绍 php对mysql数据库操作,实现修改功能 一个字段,多值传递搜索 SQL语句 发现 PHP 手册有点问题,不知道是不是 Bug? php函数 escape,unescape,unicodeToUtf8....请大家测试。 PHP群,诚者加,不要潜水员 mysql字符集问题(那边人太少了,发到这边来) 有人在php中用过BSTR 类型吗,该怎么用? 为什么PHP生成的图片不能正常显示 mysql奇怪问题?请多帮忙! 关于php文件运行速度的问题 这个最常见的CGI Error是什么原因造成的?
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-control: private");
你的方法不行的
点击返回的是一个输出页面上的按钮,
我用sefl.history.go(-1);和window.history.back();结果都是一样的
还是不行
主要问题在于,我在表单提交的页面里点击了弹出窗口后,关闭弹出窗口,然后提交表单。返回时就发现页面被reset了
我去掉Header后,还是不行
<%
dim show
show=true
if request.Form("txt")<>"" then response.Write "error" : show=false
%>
<html><head></head><body>
<div <%if not show then%> style="visibility:hidden" <% end if%>>
<form action="" method=post >
<input type=text value="<%=request.Form("txt")%>" name=txt>
<input type=button onclick="window.open('test1.asp')" value="open">
<input type=submit>
</form>
</div>
</body></html>test1.asp:
<html><head></head><body>
<input type=text value="" name=txt>
<input type=button onclick="opener.document.all.txt.value=txt.value;window.close()">
</body></html>
还是没有解决我的问题啊
如果是自动的话,返回用history.back(-1)试试看。
因为你返回的时候缓存已经清除掉了,就没了。不检查应该就不会清除了。
ob_start();
if(function_exists(session_cache_limiter)){
session_cache_limiter("private, must-revalidate");
}
//biaodan.php
<form action="save.php" method="post" target="myFrame">
<textarea name="content">表单内容了</textarea>
<input type="submit" value="提交">
</form><iframe id="myFrame" width="0" height="0" frameborder="0"></iframe>//save.php<?
if ($content==""){
echo"<script language='JavaScript'>";
echo "alert(\"请输入内容\")";
echo "</script>";
die();
}
?>
但是当我在Text2输入一些文字后,点击了旁边的open按钮,(test.htm文件可以是空白页面,或者不存在)。然后再点击submit按钮。在提示出错后,点击返回按钮,这是Text2的内容就被清空了。
大家帮我看看怎么回事啊
<?
if (isset($submit))
{
if ("" == trim($txtIn))
{
echo "error<br>";
?>
<input type="button" value="back" onClick="history.go(-1);">
<?
exit;
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>test</title>
</head>
<body>
<center>
<form action="test.php" method="get" name="f">
Text1<input type="text" name="txtIn">
<br>
Text2<input type="text" name="txtIn2">
<input type="button" onClick="window.open('test.htm','test')" value="open">
<br>
<input type="submit" value="submit" name="submit">
</form>
</center>
</body>
</html>
ob_start();
session_cache_limiter('private');
你将你说的代码加到里面去看看是否可行?
我试过了,还是不行!
要提交好多内容的啊能否有更省事的方法?
<HEAD>
<META NAME="save" CONTENT="history">
<STYLE>
.sSnapshot {behavior:url(#default#savesnapshot);}
</STYLE>
</HEAD>
<BODY>
<INPUT class=sSnapshot type=text id=oPersistInput>
</BODY>
</HTML>
<HEAD>
<META NAME="save" CONTENT="history">
<STYLE>
.saveHistory { behavior:url(#default#savehistory); }
</STYLE>
</HEAD>
<BODY>
加了历史保留功能:<br>
<textarea class=saveHistory></textarea><br>
没有加的:<br>
<textarea></textarea><p>
<input type=button onclick='javascript:location.href="http://www.163.com"' value='点击进入,再按后退键试试?'></BODY>
</HTML>
ob_start();
header("Cache-control: private");
session_cache_limiter('private');
的原因。