一.在表单填写页面: <input type="hidden" value="<%=Now()%>">
在提交处理页面,设置提交时间
复制代码 代码如下:
If DateDiff("s",request.form("intime1"), Now()) < 5 then
response.write "<SCRIPT language=JavaScript>alert('您的留言速度太快,禁止留言!');"
response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
response.end
end if
复制代码 代码如下:
yz=cstr(request.Form("yz"))
yz1=cstr(session("yz1"))
if yz1<>yz then
Response.Write("<script language=javascript>alert('请正确输入验证码!');</script>")
response.redirect("sign.asp")
end if
复制代码 代码如下:
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
'Response.Write(server_v1)
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
'Response.Write(server_v2)
if mid(server_v1,8,len(server_v2))<>server_v2 then
Response.Write("<script language=javascript>alert('禁止外部提交数据!');</script>")
response.end
end if
复制代码 代码如下:
'当用户每提交一次
if request.cookies("postnum")="" then
response.cookies("postnum")=1
response.cookies("postnum").expires=DateAdd("h", 24, Now())
else
response.cookies("postnum")=request.cookies("postnum")+1
end if
if request.cookies("postnum") > 3 then
response.write "<SCRIPT language=JavaScript>alert('今天留言次数超过限制,禁止留言!');"
response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
response.end
end if
复制代码 代码如下:
server_ip=Cstr(Request.ServerVariables("REMOTE_ADDR"))
if right(server_ip,8) = "194.165." then
response.write "禁止重叠提交194.165."
response.End()
end if
复制代码 代码如下:
dim server_v1,server_v2
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if server_v1="" or instr(server_v1,"/add.asp")<=0 or mid(server_v1,8,len(server_v2))<>server_v2 then
response.write "<SCRIPT language=JavaScript>alert('来源非法,禁止外部提交!');"
response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
response.end
end if
复制代码 代码如下:
If DateDiff("s",request.form("intime1"), Now()) < 20 then
response.write "<SCRIPT language=JavaScript>alert('您的留言速度太快了吧,禁止留言!');"
response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
response.end
end if
复制代码 代码如下:
<%'当用户每提交一次
if request.cookies("postnum")="" then
response.cookies("postnum")=1
response.cookies("postnum").expires=DateAdd("h", 24, Now())
else
response.cookies("postnum")=request.cookies("postnum")+1
end if
if request.cookies("postnum") > 5 then
response.write "<SCRIPT language=JavaScript>alert('今天留言次数超过限制,禁止留言!');"
response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
response.end
end if
%>
新闻热点
疑难解答