How do I control access to an area?
Creating a login for a section of your web site is fairly easy. First, create a login form (loginForm.asp):
<form action=loginHandler.asp method=post>
Username: <input type=text name='username'><BR>
Password: <input type=password name='password'><BR>
<input type=submit Value='Log In'><BR>
</form>
Next, create a login handler (loginHandler.asp):
<%
'---------------------------------------------------------
'-- check to see that the form was completely filled out--
'---------------------------------------------------------
if request.form("username"

="" or request.form("password"

="" then
response.redirect("loginForm.asp"
end if
'---------------------------------------------------------
'-- open your database connection and check for a record--
'---------------------------------------------------------
set conn = server.createObject("ADODB.Connection"
conn.open "<insert connection string here>"
u = lcase(request.form("username"

)
p = lcase(request.form("password"

)
sql = "select lin = count(username) from logintable where lower("
sql = sql & "username)='" & u & "' and lower(password)='" & p & "'"
set rs = conn.execute(sql)
'--------------------------------------------------------
'-- Decide whether to let them in --
'--------------------------------------------------------
if rs("lin"

<>1 then
'access Denied
response.redirect ("loginForm.asp"
end if
session("login"

=true
response.redirect ("hiThere.asp"
%>
Finally, at the top of each page, you test the session variable that you assigned in the script above:
<%
if not session("login"

then
response.redirect("loginForm.asp"
end if
%>
from