Hi, this is my first post. I have a website www.psychopanic.com and theres an IP address that I want banned from accessing my site (203.213.0.10). Does anyone here know how to make a MsSQL script that can ban ip addresses? my webhosting Plesk control panel only lets me use MsSQL.
thank you :eek: :rolleyes:

G'd evening kitkatsavvy!
I'm not aware of any SQL functionality that you can implement to block an IP address, nor i have any experience in web programming.
With sql you can limit the privileges of any user assigning that user to a given roll or just to delete him from your db users.
I have no idea how you can do that in the web environment, but i supose that if you can get the user's ip you also can redirect him out of your site.
I think you should (or any mod) move this thread to another forum, since your question is more related with web programming than with SQL.
Good luck
Estuardo

sorry about this post. since i posted that, i learnt that my webhoster supports php, plus a whole bunch of other codes like asp etc. i got a bit of help from my irc friends, and now i have 2 scripts for my website. one is to ban single ip addresses, and the other is to ban ranges of ip addresses.. i didnt know i could just change my webpages to .php instead of .htm to do this.
anyway the code is on my blog at My blog

Use
"deny from 70.38.14.129"
in .htaccess file

Hope it will make some sense.
Abdul Basit
abdul.basit1299@gmail.com

Hi, this is my first post. I have a website www.psychopanic.com and theres an IP address that I want banned from accessing my site (203.213.0.10). Does anyone here know how to make a MsSQL script that can ban ip addresses? my webhosting Plesk control panel only lets me use MsSQL.
thank you :eek: :rolleyes:

IP Guardian is designed to be an easy to use IP filtering system to secure your ASP pages against unauthorized visitors. You simply enter the IP addresses into the program and it does the rest.

Statistics will show you how many times a banned IP has attempted to visit your page.

The next version will feature even more filtering options and include a temporary ban feature.

<URL snipped>

IP Guardian is designed to be an easy to use IP filtering system to secure your ASP pages against unauthorized visitors. You simply enter the IP addresses into the program and it does the rest.

Statistics will show you how many times a banned IP has attempted to visit your page.

The next version will feature even more filtering options and include a temporary ban feature.

<snipped>

OP asked this question LONG LONG time ago. Please check the date before bumping an old thread.

you need to create table tb_IPList (IP varchar(20)) and code (in ASP) below:
<%
option explicit

Dim Conn as object
Dim RS as object

set Conn = createobject("ADODB.Connection")
Conn.Mode = 3
Conn.open "DRIVER={SQL Server};Server=YourServer;Database=YourDB"

set RS = Conn.execute ("select 1 from tb_IPList where IP = '" + Request.ServerVariables("REMOTE_ADDR")) + "'"

if not RS.EOF then
--> goto another page or error msg
else
--> continue
%>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.