

ASP留言板IP或IP段限制与限制留言次数
<%
'留言板IP限制程序
dim ips
ips = left(Request.ServerVariables("REMOTE_ADDR"),15)
response.write ips
IpLists = "127.0.|"
function isForbid(sip)
 dim Iplist,Iparr,Ipi
 Iplist = "|"& IpLists &"|" '
 Iparr = split(Iplist,"|") '生成数组
 for Ipi = 0 to ubound(Iparr) '循环查找数组IP
  if len(Iparr(Ipi)) > 0 and instr("|" & sip,"|" & Iparr(Ipi)) > 0 then
   isForbid = true
   exit function
  end if
 next
 isForbid = false
end function
if isForbid(ips) then
 Response.write "<p align=""center"">你没有留言的权限</p>"
else
 response.write "aaaaaaaaaa"
end if
'验证两次留言时间间隔 方法 01
'PostIntervalTime = 5*60 '同一个IP多长时间可以留一次言,单位是秒,5分钟可以用5*60表示,不限制请设置为0
PostIntervalTime = 1*60
 
 if int(PostIntervalTime) > 0 then
  newDate = Dateadd("s",int(PostIntervalTime)*-1,Now)
  Set rs = conn.execute("select top 1 ip from qwbmbook where ip = '"& fixsql(ip) &"' and time > #"& newDate &"#")
  if not (rs.eof and rs.bof) then
   set rs = nothing
   conn.close
   set conn = nothing
   'er "请不要频繁留言,请等分钟"& int(PostIntervalTime/60) &"留言!",""
  end if
  set rs = nothing
 end if
%>
您发布的评论即表示同意遵守以下条款:
            一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家、社会、集体和公民的合法权益;
            二、不得发布国家法律、法规明令禁止的内容;互相尊重,对自己在本站的言论和行为负责;
            三、本站对您所发布内容拥有处置权。
 苏公网安备 32070502010230号
苏公网安备 32070502010230号