User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 391,962 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,037 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 6409 | Replies: 6
Reply
Join Date: Jul 2005
Location: Townsville, Australia
Posts: 2
Reputation: kitkatsavvy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
kitkatsavvy's Avatar
kitkatsavvy kitkatsavvy is offline Offline
Newbie Poster

Solution How do I ban ip addresses using MsSQL script?

  #1  
Jul 4th, 2005
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:
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2005
Location: Portugal
Posts: 13
Reputation: Estuardo is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
Estuardo Estuardo is offline Offline
Newbie Poster

Re: How do I ban ip addresses using MsSQL script?

  #2  
Jul 15th, 2005
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
Reply With Quote  
Join Date: Jul 2005
Location: Townsville, Australia
Posts: 2
Reputation: kitkatsavvy is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
kitkatsavvy's Avatar
kitkatsavvy kitkatsavvy is offline Offline
Newbie Poster

Re: How do I ban ip addresses using MsSQL script?

  #3  
Jul 16th, 2005
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
Reply With Quote  
Join Date: Aug 2006
Posts: 1
Reputation: abdul_basit1299 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
abdul_basit1299 abdul_basit1299 is offline Offline
Newbie Poster

Solution Re: How do I ban ip addresses using MsSQL script?

  #4  
Aug 30th, 2006
Use
"deny from 70.38.14.129"
in .htaccess file

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

Originally Posted by kitkatsavvy View Post
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:
Reply With Quote  
Join Date: Feb 2008
Posts: 1
Reputation: ipban is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ipban ipban is offline Offline
Newbie Poster

Re: How do I ban ip addresses using MsSQL script?

  #5  
Feb 4th, 2008
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>
Last edited by peter_budo : Feb 5th, 2008 at 4:14 am. Reason: IP Guardian can be found on internet, no need to advertise your website by pointing download there
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 238
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: How do I ban ip addresses using MsSQL script?

  #6  
Feb 4th, 2008
Originally Posted by ipban View Post
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.
Last edited by peter_budo : Feb 5th, 2008 at 4:15 am. Reason: Just removing URL from quote
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Feb 2008
Posts: 14
Reputation: huangzhi is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 4
huangzhi huangzhi is offline Offline
Newbie Poster

Re: How do I ban ip addresses using MsSQL script?

  #7  
Feb 6th, 2008
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
%>
Hence Wijaya
www.ex-Soft.tk
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MS SQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 9:11 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC