Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Ban more than 1 IP address
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Ban more than 1 IP address

 Post Reply Post Reply Page  12>
Author
sccs View Drop Down
Groupie
Groupie
Avatar

Joined: 31 October 2002
Location: United Kingdom
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote sccs Quote  Post ReplyReply Direct Link To This Post Topic: Ban more than 1 IP address
    Posted: 10 November 2005 at 8:57am

We have a contact form on our school website and we want to stop students from the school sending SPAM. There are 2 areas of the school and both have their own IP address. I managed to get it to work with one IP but I need to add 2 IP addresses in the code.

I tried this but it did not work:
 
Dim IP
IP= Trim(Request.ServerVariables("REMOTE_ADDR"))
IF IP = "***.**.15.87" OR IP= "***.**.15.67" THEN
        RESPONSE.REDIRECT("Warning.asp")
  
  
END IF
 
 
I have removed the numbers where * is for this message.
 
I tried it with just one IP address and it worked. I think I may have writen the code wrong for the other IP.
Thanks
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2005 at 9:10am
Dim IP
IP= Trim(Request.ServerVariables("REMOTE_ADDR"))

IF IP = "***.**.15.87" OR IP= "***.**.15.67" THEN
        RESPONSE.REDIRECT("Warning.asp")
  
  
END IF

i cant see why that wont work, what error problem are you getting with the above
Back to Top
sccs View Drop Down
Groupie
Groupie
Avatar

Joined: 31 October 2002
Location: United Kingdom
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote sccs Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2005 at 9:43am
It looks like we have a problem with the IP addresses at the school. Each computer has it's own IP. So trying to block each one may be hard. Or is it?

Edited by sccs - 10 November 2005 at 9:53am
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2005 at 9:50am
not sure how the script name   /   url   will help.

you want to block the IP Ranges, are they all on the same IP Ranges.
Back to Top
sccs View Drop Down
Groupie
Groupie
Avatar

Joined: 31 October 2002
Location: United Kingdom
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote sccs Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2005 at 9:57am
Please ignore my last message. I have just edited it.
 
It looks like we have a problem with the IP addresses at the school. Each computer has it's own IP. So trying to block each one may be hard. Or is it?
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2005 at 10:01am
are they all on same IP Ranges, then you could block the ranges.
Back to Top
sccs View Drop Down
Groupie
Groupie
Avatar

Joined: 31 October 2002
Location: United Kingdom
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote sccs Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2005 at 10:03am
Yes. The first part is the same. it's just the last 15.67 that changes.
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2005 at 10:12am
try

IP= Trim(Request.ServerVariables("REMOTE_ADDR"))
IP = Left(IP,7)

IF instr(1,IP, "xxxxxx") THEN
        RESPONSE.REDIRECT("Warning.asp")
  
  
END IF


where it has xxxxxx change that for the copmmon start of the IP Address

on the second line with 7 on it above change that to the number of charecters the beginig /common part is including the .
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.