<%
'IP阻止 关键词阻止

call checkIPArrest
call checkKeywordArrest

Sub checkIPArrest
	dim ip,rs,sql
	ip=Request.ServerVariables("remote_addr")
	if ip="" then
		exit sub
	end if
	sql="select * from BBS_arrest where Kind='IP' and Content='"&ip&"'"
	set rs = conn.execute(sql)
	if not rs.eof then
		Response.write "<br><br>IP禁止["&ip&"]，不能访问本页，解禁请与管理员联系。"
		Response.End
	end if
End Sub

Sub checkKeywordArrest
	dim strRequest,keyword,rs,sql,p1,p2
	strRequest=Request.Form & Request.QueryString
	if strRequest="" then
		exit sub
	end if
	sql="select Content from BBS_arrest where Kind='Keyword' and Content<>''"
	set rs = conn.execute(sql)
	while not rs.eof
		keyword=rs("Content")
		p1=Instr(1,strRequest,keyword,1)    '文本比较（忽略大小写）
		p2=Instr(1,strRequest,server.urlencode(keyword),1)
		if p1>0 or p2>0 then
			Response.write "<br><br>禁止使用关键字： "&keyword
			Response.End
			exit sub
		end if
		rs.movenext
	wend
End Sub

%>