dereking wrote on 02 mei 2005 in microsoft.public.inetserver.asp.general:
How can I write an asp page, say, CHECKIP.asp that checks the incoming
requesting IP address and returns a protected page, based on the
checking result? That is, if the IP is a permitted address, then
presents a page, say, OK.asp. If the IP is not allowed, then sends
REJECT.asp. Both OK.asp and REJECT.asp cannot be directly accessed
without going through the CHECKIP.asp. Any idea?
You are thinking in a password surrounding,
that is not neccessary here.
========= lock.asp [can be external to accessable space]
<%
q = request.servervariables("remote_addr")
If q <> "192.168.123.123" and q <> "192.168.123.456" then
%>
<title>pseudo REJECT.asp</title>
You are out and stay out!
<%
response.end
end if
%>
======== protected page OK.asp
<!--#include virtual ="lock.asp"-->
<title>OK.asp</title>
<body>
You are in<br>
blah...blah
======== protected page OK2.asp
<!--#include virtual ="lock.asp"-->
<title>OK2.asp</title>
<body>
You can also start with this page<br>
blah...blah
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)