表单提交问题!在一分钟内限制提交

jjunix 2003-07-12 03:14:19
怎样限制表单重复提交在,限制在一分钟内不能提交。谢谢!
...全文
173 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
jzywh 2003-07-12
  • 打赏
  • 举报
回复
用Cookies记录上次提交时间

在于当前时间相比较
zhxhjj 2003-07-12
  • 打赏
  • 举报
回复
建议同上
ceocio 2003-07-12
  • 打赏
  • 举报
回复
第一次提交表单后:
<%session("posttime")=now()%>

后面判断:
if not isnull(session("posttime")) or cint(posttime)>0 then
if DateDiff("s",session("posttime"),Now())<cint(postTime) then
response.write "错误,必须间隔60秒"
end if
end if

变量s 为间隔时间

-----------------------
Welcome to My Website
http://www.ceocio.net
-----------------------
zhangguagua 2003-07-12
  • 打赏
  • 举报
回复
<input type="submit" name="gua">
<script>
document.all.gua.disabled=true;
time1=setTimeout("guagua()",60000);
function guagua()
{
document.all.gua.disabled=false;
clearTimeout(time1);
}
</script>
jjunix 2003-07-12
  • 打赏
  • 举报
回复
谢啦
cloudchen 2003-07-12
  • 打赏
  • 举报
回复
第一次提交写入一个cookie,expire为1 minute
每次提交的时候检测一下这个cookie是否存在就可以了
jjunix 2003-07-12
  • 打赏
  • 举报
回复
没人知道吗

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧