473,698 Members | 2,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to block IP address in a guestbook?

I use a free database-driven ASP guestbook. I want to add a IP address
blocking filter to it( just to block one particular guest). What is the
easiest way to do so? Thanks.

pcchong
Jul 19 '05 #1
14 26488
PW

"pcchong" <pc*****@singne t.com.sg> wrote in message
news:eu******** *****@TK2MSFTNG P12.phx.gbl...
I use a free database-driven ASP guestbook. I want to add a IP address
blocking filter to it( just to block one particular guest). What is the
easiest way to do so? Thanks.

Put this at the beginning of the first ASP (change "111.222.33 3" to your
enemys IP address) ...

<%
if Request.ServerV ariables("REMOT E_ADDR") = "111.222.33 3" then
Response.End
end if
%>
Jul 19 '05 #2
"pcchong" wrote in message news:eu******** *****@TK2MSFTNG P12.phx.gbl...
: I use a free database-driven ASP guestbook. I want to add a IP address
: blocking filter to it( just to block one particular guest). What is the
: easiest way to do so? Thanks.

I don't know where you're coming from [IP address] so you would have to
modify this but directions are included. I'm redirecting everyone as an
example. Modify the appropriate lines and then put this at the top of your
page where you want to block someone. However, if their IP is dynamic, then
you'd need to modify it to block IP ranges.

<%@ Language=VBScri pt %>
<%
Option Explicit
Response.Buffer = True
dim outtahair, visitor, strURL
strURL = "http://www.fbi.gov/mostwant.htm" ' modify this line for target
redirect host
outtahair = Request.ServerV ariables("REMOT E_HOST")
' Delete the line above and uncomment the one below replacing x.x.x.x with
IP to redirect
' outtahair = "x.x.x.x"
visitor = Request.ServerV ariables("REMOT E_HOST")
if visitor = outtahair then
Response.Clear( )
Response.Redire ct(strURL)
end if
%>

http://kiddanger.com/lab/remotehostredirect.asp

HTH...

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #3
On Wed, 19 May 2004 19:29:20 +0800, "PW" <pw*@NObigSPAMp ond.net.au>
wrote:

"pcchong" <pc*****@singne t.com.sg> wrote in message
news:eu******* ******@TK2MSFTN GP12.phx.gbl...
I use a free database-driven ASP guestbook. I want to add a IP address
blocking filter to it( just to block one particular guest). What is the
easiest way to do so? Thanks.

Put this at the beginning of the first ASP (change "111.222.33 3" to your
enemys IP address) ...

<%
if Request.ServerV ariables("REMOT E_ADDR") = "111.222.33 3" then
Response.End
end if
%>


Better would be to check the address and if it's not allowed, simply
not update the guestbook. Let them go through the process, thank them
for their entry, just don't record it. :)

Jeff
Jul 19 '05 #4
Thanks. It works for specific IP, but what if it is a IP range, say
210.187.176.# to 210.187.176.### . How do I change the line? Thanks.
pcchong

"PW" <pw*@NObigSPAMp ond.net.au> wrote in message
news:uR******** ******@TK2MSFTN GP12.phx.gbl...

"pcchong" <pc*****@singne t.com.sg> wrote in message
news:eu******** *****@TK2MSFTNG P12.phx.gbl...
I use a free database-driven ASP guestbook. I want to add a IP address
blocking filter to it( just to block one particular guest). What is the
easiest way to do so? Thanks.

Put this at the beginning of the first ASP (change "111.222.33 3" to your
enemys IP address) ...

<%
if Request.ServerV ariables("REMOT E_ADDR") = "111.222.33 3" then
Response.End
end if
%>

Jul 19 '05 #5
Use Instr(), or a Regular Expression.

Instr():

dim sIP
sIP = Request.ServerV ariables("REMOT E_ADDR")

if Instr(sIP, "111.222.33 3") > 0 then

For more complicated patterns, you should use a Regular Expression.

Bob Barrows

pcchong wrote:
Thanks. It works for specific IP, but what if it is a IP range, say
210.187.176.# to 210.187.176.### . How do I change the line? Thanks.
pcchong

"PW" <pw*@NObigSPAMp ond.net.au> wrote in message
news:uR******** ******@TK2MSFTN GP12.phx.gbl...

"pcchong" <pc*****@singne t.com.sg> wrote in message
news:eu******** *****@TK2MSFTNG P12.phx.gbl...
I use a free database-driven ASP guestbook. I want to add a IP
address blocking filter to it( just to block one particular guest).
What is the easiest way to do so? Thanks.

Put this at the beginning of the first ASP (change "111.222.33 3" to
your enemys IP address) ...

<%
if Request.ServerV ariables("REMOT E_ADDR") = "111.222.33 3" then
Response.End
end if
%>


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #6
Thanks. This is a better way.
pcchong

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:uW******** *****@TK2MSFTNG P12.phx.gbl...
Use Instr(), or a Regular Expression.

Instr():

dim sIP
sIP = Request.ServerV ariables("REMOT E_ADDR")

if Instr(sIP, "111.222.33 3") > 0 then

For more complicated patterns, you should use a Regular Expression.

Bob Barrows

pcchong wrote:
Thanks. It works for specific IP, but what if it is a IP range, say
210.187.176.# to 210.187.176.### . How do I change the line? Thanks.
pcchong

"PW" <pw*@NObigSPAMp ond.net.au> wrote in message
news:uR******** ******@TK2MSFTN GP12.phx.gbl...

"pcchong" <pc*****@singne t.com.sg> wrote in message
news:eu******** *****@TK2MSFTNG P12.phx.gbl...
I use a free database-driven ASP guestbook. I want to add a IP
address blocking filter to it( just to block one particular guest).
What is the easiest way to do so? Thanks.
Put this at the beginning of the first ASP (change "111.222.33 3" to
your enemys IP address) ...

<%
if Request.ServerV ariables("REMOT E_ADDR") = "111.222.33 3" then
Response.End
end if
%>


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #7
My joy is shortlived. This guest still managed to enter with the same IP
(within the IP range that the IP blocking filter set). How can he get
through? Thanks.

pcchong

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:uW******** *****@TK2MSFTNG P12.phx.gbl...
Use Instr(), or a Regular Expression.

Instr():

dim sIP
sIP = Request.ServerV ariables("REMOT E_ADDR")

if Instr(sIP, "111.222.33 3") > 0 then

For more complicated patterns, you should use a Regular Expression.

Bob Barrows

pcchong wrote:
Thanks. It works for specific IP, but what if it is a IP range, say
210.187.176.# to 210.187.176.### . How do I change the line? Thanks.
pcchong

"PW" <pw*@NObigSPAMp ond.net.au> wrote in message
news:uR******** ******@TK2MSFTN GP12.phx.gbl...

"pcchong" <pc*****@singne t.com.sg> wrote in message
news:eu******** *****@TK2MSFTNG P12.phx.gbl...
I use a free database-driven ASP guestbook. I want to add a IP
address blocking filter to it( just to block one particular guest).
What is the easiest way to do so? Thanks.
Put this at the beginning of the first ASP (change "111.222.33 3" to
your enemys IP address) ...

<%
if Request.ServerV ariables("REMOT E_ADDR") = "111.222.33 3" then
Response.End
end if
%>


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #8
On Fri, 21 May 2004 21:53:32 +0800, "pcchong" <pc*****@singne t.com.sg>
wrote:
My joy is shortlived. This guest still managed to enter with the same IP
(within the IP range that the IP blocking filter set). How can he get
through? Thanks.
Good question. But what did you do with Bob's code? Are you sure
you're blocking that IP and not just checking to see what it is?

Jeff
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:uW******* ******@TK2MSFTN GP12.phx.gbl...
Use Instr(), or a Regular Expression.

Instr():

dim sIP
sIP = Request.ServerV ariables("REMOT E_ADDR")

if Instr(sIP, "111.222.33 3") > 0 then

For more complicated patterns, you should use a Regular Expression.

Bob Barrows

pcchong wrote:
> Thanks. It works for specific IP, but what if it is a IP range, say
> 210.187.176.# to 210.187.176.### . How do I change the line? Thanks.
>
>
> pcchong
>
> "PW" <pw*@NObigSPAMp ond.net.au> wrote in message
> news:uR******** ******@TK2MSFTN GP12.phx.gbl...
>>
>> "pcchong" <pc*****@singne t.com.sg> wrote in message
>> news:eu******** *****@TK2MSFTNG P12.phx.gbl...
>>> I use a free database-driven ASP guestbook. I want to add a IP
>>> address blocking filter to it( just to block one particular guest).
>>> What is the easiest way to do so? Thanks.
>>
>>
>> Put this at the beginning of the first ASP (change "111.222.33 3" to
>> your enemys IP address) ...
>>
>> <%
>> if Request.ServerV ariables("REMOT E_ADDR") = "111.222.33 3" then
>> Response.End
>> end if
>> %>


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Jul 19 '05 #9
I place this in the beginning of the first asp:

<%
dim sIP
sIP = Request.ServerV ariables("REMOT E_ADDR")
if Instr(sIP, "###.###.## #") > 0 then
Response.End
end if
%>

Anything wrong? Please advise. Thanks.

pcchong

"Jeff Cochran" <jc************ *@naplesgov.com > wrote in message
news:40******** *******@msnews. microsoft.com.. .
On Fri, 21 May 2004 21:53:32 +0800, "pcchong" <pc*****@singne t.com.sg>
wrote:
My joy is shortlived. This guest still managed to enter with the same IP
(within the IP range that the IP blocking filter set). How can he get
through? Thanks.


Good question. But what did you do with Bob's code? Are you sure
you're blocking that IP and not just checking to see what it is?

Jeff
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:uW******* ******@TK2MSFTN GP12.phx.gbl...
Use Instr(), or a Regular Expression.

Instr():

dim sIP
sIP = Request.ServerV ariables("REMOT E_ADDR")

if Instr(sIP, "111.222.33 3") > 0 then

For more complicated patterns, you should use a Regular Expression.

Bob Barrows

pcchong wrote:
> Thanks. It works for specific IP, but what if it is a IP range, say
> 210.187.176.# to 210.187.176.### . How do I change the line? Thanks.
>
>
> pcchong
>
> "PW" <pw*@NObigSPAMp ond.net.au> wrote in message
> news:uR******** ******@TK2MSFTN GP12.phx.gbl...
>>
>> "pcchong" <pc*****@singne t.com.sg> wrote in message
>> news:eu******** *****@TK2MSFTNG P12.phx.gbl...
>>> I use a free database-driven ASP guestbook. I want to add a IP
>>> address blocking filter to it( just to block one particular guest).
>>> What is the easiest way to do so? Thanks.
>>
>>
>> Put this at the beginning of the first ASP (change "111.222.33 3" to
>> your enemys IP address) ...
>>
>> <%
>> if Request.ServerV ariables("REMOT E_ADDR") = "111.222.33 3" then
>> Response.End
>> end if
>> %>

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
15967
by: Dariusz | last post by:
I am a beginner in PHP and MySQL, and am working through a book and various online tutorials on PHP and MySQL and now stuck - installed everything on "localhost" and it all works fine. My question is as follows. I have a guestbook type code I'm trying to write, but when the results get printed to a webpage, it outputs completely nothing as what was entered in the guestbook database. No errors appear to be generated, and I can't see if...
4
1378
by: knoak | last post by:
If a filter with bad words etc. isn't what you mean, you could put an extra field in the DB, called 'OK' or something like that. When someone enters a message in the GB, the initial value of 'OK' is 0. You receive a link/message by mail, telling you that there is a new entry. you log in into the admin part, read the message, and set ok to 1 (for instance by checkbox)or delete the message if it's nonsense.
1
6221
by: Rune Runnestø | last post by:
Hi, I have made a small program that doesn't work quite the way it should. It is a guestbook for the web, where visitors can write back their greetings. The program consists of 3 files: - guestbook.jsp -> this is the form - writeToFile -> writing the captured data from the form to a file - readFromFile -> reading all the greetings to the file guestbook.jsp Here is the file Guestbook.jsp: ------------------------------ <!--...
6
11182
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I will include the code I originally used. I understand I should switch from CDONTS to CDO mail but after several sttempts I am finding a very hard time getting the new CDO mail to work properly. Any assistance with this would be greatly...
1
11976
by: Viken Karaguesian | last post by:
Hello everyone, Just wanting some advice. I'd like to start removing the Microsoft-generated guestbook (a feature of FrontPage) on my websites but I'm not sure if it can be done just using HTML. There seems to be a lot of server-side processing going on. The guesbooks are setup in such a fashion that when user submits an entry, not only is it posted in the page for public viewing, but I also receive an e-mail letting me kow that the...
4
5928
imarkdesigns
by: imarkdesigns | last post by:
hello guys, im in need of something... something that can validate individual entry to my guestbook... which it can validate the entry pass to my form when someone signed on it.... my custom guestbook contains: Name Email Website Referrer
2
4760
by: martin lanny | last post by:
Simple network scanner is a part of my dotnet solution. It pings ip addresses in a selected network range and gives me the response time for each computer it finds. Anyhow, I would need to retrieve two more pieces of information for each active (local network) IP address: - Computer's Host Name - Mac Address
4
10332
by: infoseekar | last post by:
HI Guys I am a beginner. I am trying to create a guestbook. I have the code for it and it is in three parts. Part 1 "dp.php" to open database and make connection Part 2 "index.php" which will show the guestbook entries and Part 3 "add.php" to add new entry. The problems is when i run any of the file nothing happens i.e. no error(s) and no result. I tired to check the code so many times and couldnt any find any errors. Part 1
5
25637
Thekid
by: Thekid | last post by:
Hi, I'm using xampplite and I'm trying to make a guestbook and a forms page where you can post to the guestbook with PHP & MySQL. I got the code from a website but it wasn't working so I tinkered with it a little and it's closer but not quite right. I made a database named 'guestbook' with a table named 'visitors'. In it are the following fields: TimeStamp Name Last email comment Here is the code to the guestbook (guestbook.php),...
0
8680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.