Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ip ban
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ip ban

 Post Reply Post Reply
Author
zadax View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 19 January 2003
Location: Israel
Status: Offline
Points: 433
Post Options Post Options   Thanks (0) Thanks(0)   Quote zadax Quote  Post ReplyReply Direct Link To This Post Topic: ip ban
    Posted: 30 March 2003 at 12:50pm

hi , i want to ban somone . and i get help from MADDOG this is the Code :

<%
Dim IP_truth
Dim NumberOf

'Creating the Array, with the number of ip's your blocking (please note 0 = one , 1 = two - same as a Array!)
Dim Ip_array(5)

'Find Visters IP
IP_truth = request.servervariables("REMOTE_ADDR")

'At this point we are defining the number of IP addresses we are going to block (please note 0 = one , 1 = two - same as a Array!)
NumberOf = 5

'IP numbers to block (please note 0 = one , 1 = two - same as a Array!)
Ip_array(0) = "127.0.0.1"
Ip_array(1) = "203.45.142.41" 
Ip_array(3) = "12.232.31.166"
Ip_array(4) = "12.245.59.175"
Ip_array(5) = "149.99.116.62"

'Here we are looping through the Array and checking the IP address of each, if a banned IP is found , we print out a statement saying that they are banned, and the page stops processing. You could always change the Response.write statement to a redirect to a Central Banned page.
For I = 0 to NumberOf
If Ip_array(I) = IP_truth then 

'Page to redirect if there IP is blocked
Response.Redirect "banned.asp"

End If 
next
%>

i changed the Ips . and it write me that whan i try to upload the Defualt Page (i added the Code to the Defualt)

Microsoft VBScript runtime error '800a01f4'

Variable is undefined: 'I'

/zadax/default.asp, line 44

Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post Posted: 30 March 2003 at 4:34pm

Place this line:

Dim i     'as integer

before this:

For I = 0 to NumberOf

Cheers,
Andrew

There have been many, many posts made throughout the world...
This was one of them.
Back to Top
zadax View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 19 January 2003
Location: Israel
Status: Offline
Points: 433
Post Options Post Options   Thanks (0) Thanks(0)   Quote zadax Quote  Post ReplyReply Direct Link To This Post Posted: 31 March 2003 at 1:12am

Tnx ,,,,,

one more thing  ..... i need to place the code in Eace of pages ?

or i can added it to one page and the ip will be blocked in all the Forum ?

Back to Top
The.Jay View Drop Down
Newbie
Newbie


Joined: 08 May 2003
Location: United Kingdom
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote The.Jay Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2003 at 9:40am
you could put it in a include file. like header.asp.
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2003 at 12:22pm
Actually common.asp is probably the best place to place it and be sure that banned.asp does not include whatever file you place it in.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2003 at 1:25pm

Web Wiz Forums already comes with an IP banning feature.

If you are logged in as an admin you can see the IP address of the poster at the top of the message, simply click the IP address and you get the choice to ban that IP address or change it so that you ban the IP range.

Back to Top
 Post Reply Post Reply

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.