in message : 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