表单内容不允许重复提交
这是源码<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!-- #include file="conn.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<%
dim rst,sql,rst1,sql1,myerrors
set rst=server.CreateObject("adodb.recordset")
set rst1=server.CreateObject("adodb.recordset")
if request.QueryString("act")="add" then
sql1="select * from message where m_ip='"& Request.ServerVariables("LOCAL_ADDR") & "'"
rst1.open sql1,conn,1,1
if DateDiff("s",rst1("m_intime"),Now ) < 60 then
response.write"<script language=JavaScript>alert('对不起,相同IP,1分钟内不允许重复提交!');"&"window.location.href = 'index.asp'"&" </script>"
else
sql="select * from message"
rst.open sql,conn,1,3
rst.addnew
rst("m_content")=request.Form("textarea")
rst("m_ip")=Request.ServerVariables("LOCAL_ADDR")
rst.update
rst.close
set myerrors=conn.errors
if myerrors.count=0 then
response.write "<script language=JavaScript>alert('添加成功!');"&"window.location.href = 'index.asp'"&" </script>"
else
response.write "<script language=JavaScript>alert('添加失败!原因:');" & "history.back()" & "</script>" & myerrors.item(0).description
end if
end if
end if
%>
<body>
<form id="form1" name="form1" method="post" action="time.asp?act=add">
<label>
<textarea name="textarea"></textarea>
<br />
<input type="submit" name="Submit" value="提交" />
</label>
</p>
</form>
</body>
</html>
这是错误信息
错误类型:
(0x80020009)
发生意外。
/ceshi/time.asp, 第 15 行
请大侠们帮帮忙!