I already have the script to protect my web from unauthorized users, but how can I give different levels to different users?
My idea is to have seperate columns in my table. For instance I would have UserID, Password, Admin, Guest, Member as my columns - the last three would be the different levels. To make it work I need to incorperate a statement that will look for a "yes" in the admin column if they are trying to log in to an admin protected page.
This is my current script:
<%
Dim adoCon
Dim strCon
Dim rsCheckAdminUser
Dim strAccessDB
Dim strSQL
Dim strAdminUserName
strAdminUserName = Request.Form("txtAdminUserName")
strAccessDB = "../********/**************.mdb"
Set adoCon = Server.CreateObject("ADODB.Connection")
strCon = "DRIVER={Microsoft Access Driver (*.mdb)};pwd=****; DBQ=" & Server.MapPath(strAccessDB)
adoCon.Open strCon
Set rsCheckAdminUser = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblAdminUsers.Password FROM tblAdminUsers WHERE tblAdminUsers.UserID ='" & strAdminUserName & "'"
rsCheckAdminUser.Open strSQL, strCon
If NOT rsCheckAdminUser.EOF Then
If (Request.Form("txtAdminUserPass")) = rsCheckAdminUser("Password") Then
Session("AdminUserGood") = True
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckAdminUser = Nothing
Response.Redirect"admin.asp?name=" & strAdminUserName
End If
End If
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckAdminUser = Nothing
Session("AdminUserGood") = False
Response.Redirect"unauthorized_admin.htm"
%>
<head><title>Check Admin ID</title></head>
Can someone pleeeeeeeeeeease help. 