Block Multiple IP Addresses

Submitted by:Jhon Brain

Date added:20 March, 2013


ASP code example to block Multiple IP Addresses

Tags: block ip

Code Snippet:

'declare variables
Dim sIP
Dim sIParray(2)
'assign our blocked IP addresses to our array
sIParray(0) = ""
sIParray(1) = ""
sIParray(2) = ""
'retrieve the visitors IP address
sIP = Request.ServerVariables("REMOTE_ADDR")

'loop through the banned IPs using the UBound function
For i = 0 to UBound(sIParray)
'check if IP address matches any of the blocked IPs
If sIP = sIParray(i) Then
Response.Redirect "no_access.asp"
End If