Check out these articles:
Implementing a secure site with ASP IIS Security Overview If you want to roll your own permissions, then 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):
<% u = lcase(request.form("username")) p = lcase(request.form("password")) '--------------------------------------------------------- '-- check to see that the form was completely filled out-- '--------------------------------------------------------- if u="" or p="" then response.redirect("loginForm.asp") end if '--------------------------------------------------------- '-- check for a match, this could be against a database!-- '--------------------------------------------------------- if u<>"myusername" or p<>"mypassword" then 'access denied response.redirect ("loginForm.asp") else ' let them in! session("login")=true response.redirect ("hiThere.asp") end if %> |
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 %> |
You could also do something similar using a database, where you would only have to check that the username and password exist in a table of many u/p combinations (in the above example, you have to manually program each username/password you want to support).