Regular Expression to check whether the access IP address is valid

Source: Internet
Author: User

Regular Expression to check whether the access IP address is valid


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.exe conn.exe cute (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
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> commandid location.href?'ignoreip.htm' </script>"
End if
End sub


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.