我是靠谱客的博主 刻苦钻石,这篇文章主要介绍正则表达式检查来访IP是否合法的实际应用,现在分享给大家,希望可以做个参考。

正则表达式检查来访IP是否合法的实际应用 

  
sub chkIP(boardid)
dim rsIP
dim ipArr
dim ignored
dim i
dim ip
dim sql 
ip=Request.ServerVariables("REMOTE_ADDR") 
ignored=false
if not isempty(boardid) then 
sql="select ignoreip from board where boardid="&cstr(boardid)
set rsIP=conn.execute(sql)
if not (rsIP.eof and rsIP.bof) then 
if instr(cstr(rsIP("ignoreip")&""),chr(13)&chr(10)) then 
iparr=split(rsIP("ignoreip"),chr(13)&chr(10))
for i=0 to ubound(iparr)
if trim(iparr(i))<>"" and left(ip,len(trim(iparr(i))))=trim(iparr(i)) then 
ignored=true
exit for
end if
next
else
iparr=rsIP("ignoreip")
if ip=trim(iparr) then 
ignored=true
end if
end if
end if
rsIP.close
end if
if ignored then 
response.write "<script language=javascript>window.location.href='ignoreip.htm'</script>"
end if
end sub 

 

最后

以上就是刻苦钻石最近收集整理的关于正则表达式检查来访IP是否合法的实际应用的全部内容,更多相关正则表达式检查来访IP是否合法内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(196)

评论列表共有 0 条评论

立即
投稿
返回
顶部