|
|
<%
dim conn, rs, sql
dim Username, Password
dim LoginError
if request.form("Submit") = "Submit" then
Set conn = Server.CreateObject("ADODB.Connection")
conn.connectionstring = Application("ConnString")
conn.open
Username = Ucase(request.form("username"))
Password = request.form("password")
Set rs = conn.Execute("Select * FROM Admins WHERE Username = '"&Username&"' AND Password = '"&Password&"'")
if NOT(rs.eof) then '** Case Insensitive Match found **'
if Ucase(rs("UserName")) = UserName AND rs("Password") = Password then '** Case Sensitive Match found, It's all good! **'
Session("Admin") = TRUE
Session("AdminID") = rs("idAdmin")
Session("Access") = rs("Access")
rs.close()
conn.Close()
Set rs=nothing
Set conn=nothing
response.redirect("admin.asp")
else
LoginError = "1" 'Password Case Mismatch
end if
else
LoginError = "2" 'Username and password mismatch
end if
rs.close()
conn.Close()
Set rs=nothing
Set conn=nothing
end if
%>
<% if LoginError = "2" then %>
Your username and Password do not match. Please try again: |
<% elseif LoginError = "1" then %>
Your Password is incorrect. Remember, it's case sensitive. Please try again: |
<% end if %>
|