Forums

ASP

This topic is locked

Help with Blocking an Annoying User's IP address

Posted 11 Feb 2003 00:42:36
1
has voted
11 Feb 2003 00:42:36 Rip Munsterman posted:
I have a feedback form on my website, and some looser in Amsterdamn keeps sending stupid feedback messages. He has been doing this in the morning and evening hours for three days now, and sends 5 to 10 at a time. Each time he does, everyone in our webteam gets an email as if it were a feedback submission. He does not have a static IP address, but his IP addresses all contain "212.98.16.". I know how to block static IP addresses from an ASP page using a conditional statement, but can anyone tell me how (or if) I could create an "if then" statement containing a wildcard?

for example:

<%
Dim IP_Address
IP_Address = Request.ServerVariables("REMOTE_HOST"

if IP_Address <> "212.98.16.*" then ...


Thanks for any help in advance!

Replies

Replied 11 Feb 2003 06:20:48
11 Feb 2003 06:20:48 Owen Eastwick replied:
Try something like:

<%
IP_Address = Request.ServerVariables("REMOTE_HOST"
If InStr(IP_Address, "212.98.16." <> 0 then
Response.Write("Get lost loser"
Else
Response.Write("Welcome"
End If
%>

Regards

Owen.

-------------------------------------------------------------------------------------------
Used programming books and web development software for sale (UK only):
www.tdsf.co.uk/tdsfdemo/Shop.htm


Multiple Parameter UD4 / Access 2000 Search Tutorial:
www.tdsf.co.uk/tdsfdemo/
Replied 13 Feb 2003 21:32:14
13 Feb 2003 21:32:14 Rip Munsterman replied:
Ha ha ha!! That worked perfectly! I love the error message!

Thanks for all your help, Owen.

Rip

Reply to this topic