如何验证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
上一篇: 天地图地图服务调用
下一篇: 看动画学算法之:排序-count排序