473,238 Members | 1,939 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,238 software developers and data experts.

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 26403
PW

"pcchong" <pc*****@singnet.com.sg> wrote in message
news:eu*************@TK2MSFTNGP12.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.333" to your
enemys IP address) ...

<%
if Request.ServerVariables("REMOTE_ADDR") = "111.222.333" then
Response.End
end if
%>
Jul 19 '05 #2
"pcchong" wrote in message news:eu*************@TK2MSFTNGP12.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=VBScript %>
<%
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.ServerVariables("REMOTE_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.ServerVariables("REMOTE_HOST")
if visitor = outtahair then
Response.Clear()
Response.Redirect(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*@NObigSPAMpond.net.au>
wrote:

"pcchong" <pc*****@singnet.com.sg> wrote in message
news:eu*************@TK2MSFTNGP12.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.333" to your
enemys IP address) ...

<%
if Request.ServerVariables("REMOTE_ADDR") = "111.222.333" 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*@NObigSPAMpond.net.au> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...

"pcchong" <pc*****@singnet.com.sg> wrote in message
news:eu*************@TK2MSFTNGP12.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.333" to your
enemys IP address) ...

<%
if Request.ServerVariables("REMOTE_ADDR") = "111.222.333" then
Response.End
end if
%>

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

Instr():

dim sIP
sIP = Request.ServerVariables("REMOTE_ADDR")

if Instr(sIP, "111.222.333") > 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*@NObigSPAMpond.net.au> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...

"pcchong" <pc*****@singnet.com.sg> wrote in message
news:eu*************@TK2MSFTNGP12.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.333" to
your enemys IP address) ...

<%
if Request.ServerVariables("REMOTE_ADDR") = "111.222.333" 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******@NOyahoo.SPAMcom> wrote in message
news:uW*************@TK2MSFTNGP12.phx.gbl...
Use Instr(), or a Regular Expression.

Instr():

dim sIP
sIP = Request.ServerVariables("REMOTE_ADDR")

if Instr(sIP, "111.222.333") > 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*@NObigSPAMpond.net.au> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...

"pcchong" <pc*****@singnet.com.sg> wrote in message
news:eu*************@TK2MSFTNGP12.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.333" to
your enemys IP address) ...

<%
if Request.ServerVariables("REMOTE_ADDR") = "111.222.333" 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******@NOyahoo.SPAMcom> wrote in message
news:uW*************@TK2MSFTNGP12.phx.gbl...
Use Instr(), or a Regular Expression.

Instr():

dim sIP
sIP = Request.ServerVariables("REMOTE_ADDR")

if Instr(sIP, "111.222.333") > 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*@NObigSPAMpond.net.au> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...

"pcchong" <pc*****@singnet.com.sg> wrote in message
news:eu*************@TK2MSFTNGP12.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.333" to
your enemys IP address) ...

<%
if Request.ServerVariables("REMOTE_ADDR") = "111.222.333" 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*****@singnet.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******@NOyahoo.SPAMcom> wrote in message
news:uW*************@TK2MSFTNGP12.phx.gbl...
Use Instr(), or a Regular Expression.

Instr():

dim sIP
sIP = Request.ServerVariables("REMOTE_ADDR")

if Instr(sIP, "111.222.333") > 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*@NObigSPAMpond.net.au> wrote in message
> news:uR**************@TK2MSFTNGP12.phx.gbl...
>>
>> "pcchong" <pc*****@singnet.com.sg> wrote in message
>> news:eu*************@TK2MSFTNGP12.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.333" to
>> your enemys IP address) ...
>>
>> <%
>> if Request.ServerVariables("REMOTE_ADDR") = "111.222.333" 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.ServerVariables("REMOTE_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*****@singnet.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******@NOyahoo.SPAMcom> wrote in message
news:uW*************@TK2MSFTNGP12.phx.gbl...
Use Instr(), or a Regular Expression.

Instr():

dim sIP
sIP = Request.ServerVariables("REMOTE_ADDR")

if Instr(sIP, "111.222.333") > 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*@NObigSPAMpond.net.au> wrote in message
> news:uR**************@TK2MSFTNGP12.phx.gbl...
>>
>> "pcchong" <pc*****@singnet.com.sg> wrote in message
>> news:eu*************@TK2MSFTNGP12.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.333" to
>> your enemys IP address) ...
>>
>> <%
>> if Request.ServerVariables("REMOTE_ADDR") = "111.222.333" 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
Are you sure the offender has an ip that should be blocked by this
statement? How are you verifying this?

Are you sure Request.ServerVariables("REMOTE_ADDR") contains that ip
address? How are you verifying this?

Bob Barrows
pcchong wrote:
I place this in the beginning of the first asp:

<%
dim sIP
sIP = Request.ServerVariables("REMOTE_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*****@singnet.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.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #11
I can see his IP from the guestbook. I tested this filter using my IP
address and it worked, that is why I am so puzzled. I would appreciate it if
you could suggest how I can verify the IP. Many thanks again.

pcchong

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:eZ**************@tk2msftngp13.phx.gbl...
Are you sure the offender has an ip that should be blocked by this
statement? How are you verifying this?

Are you sure Request.ServerVariables("REMOTE_ADDR") contains that ip
address? How are you verifying this?

Bob Barrows
pcchong wrote:
I place this in the beginning of the first asp:

<%
dim sIP
sIP = Request.ServerVariables("REMOTE_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*****@singnet.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.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 19 '05 #12
PW

"pcchong" <pc*****@singnet.com.sg> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I can see his IP from the guestbook. I tested this filter using my IP
address and it worked, that is why I am so puzzled. I would appreciate it if you could suggest how I can verify the IP. Many thanks again.

Perhaps you enemy is bypassing the initial (menu?) ASP and going straight to
the guestbook ASP. Move the new code from your initial (menu) ASP over to
the page where you insert the guestbook information into your database.
That way, you enemy will be able to type in a post, but it won't get written
to your database, and therefore no one will ever see it.

HTH,
PW

Jul 19 '05 #13
PW wrote on 23 mei 2004 in microsoft.public.inetserver.asp.general:
"pcchong" <pc*****@singnet.com.sg> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I can see his IP from the guestbook. I tested this filter using my IP
address and it worked, that is why I am so puzzled. I would
appreciate it

if
you could suggest how I can verify the IP. Many thanks again.

Perhaps you enemy is bypassing the initial (menu?) ASP and going
straight to the guestbook ASP. Move the new code from your initial
(menu) ASP over to the page where you insert the guestbook information
into your database. That way, you enemy will be able to type in a
post, but it won't get written to your database, and therefore no one
will ever see it.


why not block both pages?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #14
Yes, you are right. Instead of just put the filter in the index(first) file,
I should put it also in the other input files. Problem solved. Many many
thanks to everyone.

pcchong

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
PW wrote on 23 mei 2004 in microsoft.public.inetserver.asp.general:
"pcchong" <pc*****@singnet.com.sg> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I can see his IP from the guestbook. I tested this filter using my IP
address and it worked, that is why I am so puzzled. I would
appreciate it

if
you could suggest how I can verify the IP. Many thanks again.

Perhaps you enemy is bypassing the initial (menu?) ASP and going
straight to the guestbook ASP. Move the new code from your initial
(menu) ASP over to the page where you insert the guestbook information
into your database. That way, you enemy will be able to type in a
post, but it won't get written to your database, and therefore no one
will ever see it.


why not block both pages?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 19 '05 #15

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

Similar topics

4
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...
4
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...
1
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: -...
6
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...
1
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....
4
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...
2
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...
4
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...
5
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.