Print Page | Close Window

ip ban

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=1487
Printed Date: 01 April 2026 at 12:36am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ip ban
Posted By: zadax
Subject: ip ban
Date 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




Replies:
Posted By: Bunce
Date 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.


Posted By: zadax
Date 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 ?



Posted By: The.Jay
Date Posted: 08 May 2003 at 9:40am
you could put it in a include file. like header.asp.


Posted By: ljamal
Date 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.


Posted By: WebWiz-Bruce
Date 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.



-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net