<% Response.Expires = -1000 'Makes the browser not cache this page Response.Buffer = True 'Buffers the content so our Response.Redirect will work Dim Error_Msg login = Request.Form("login") If login = "login_again" Then Session("UserLoggedIn") = "" ShowLogin Else If Session("UserLoggedIn") = "true" Then AlreadyLoggedIn Else If login = "true" Then CheckLogin Else ShowLogin End If End If End If Sub ShowLogin Response.Write(Error_Msg & "
") %> Windsor Distribution User Login

Windsor Distribution

Windsor Distribution Delivery Database:

User Name: 
Password :  

<% End Sub Sub AlreadyLoggedIn %>

You are already logged in. Do you want to logout or login as a different user?

<% End Sub Sub CheckLogin Dim Conn, cStr, sql, RS, username, userpwd username = Request.Form("username") userpwd = Request.Form("userpwd") Set Conn = Server.CreateObject("ADODB.Connection") cStr = "DRIVER={Microsoft Access Driver (*.mdb)};" cStr = cStr & "DBQ=" & Server.MapPath("search\users.mdb") & ";" Conn.Open(cStr) sql = "select username from USER where USERNAME = '" & LCase(username) & "'" sql = sql & " and PASSWORD = '" & LCase(userpwd) & "'" sql = sql & " and PACKFURN = 1" sql = sql & " and ACCLEVEL = 1" Set RS = Conn.Execute(sql) If RS.BOF And RS.EOF Then Else Session("UserLoggedIn") = "true" Response.Redirect "packsearchpro.asp" End If sql = "select username from USER where USERNAME = '" & LCase(username) & "'" sql = sql & " and PASSWORD = '" & LCase(userpwd) & "'" sql = sql & " and PACKFURN = 1" sql = sql & " and ACCLEVEL = 0" Set RS = Conn.Execute(sql) If RS.BOF And RS.EOF Then Else Session("UserLoggedIn") = "true" Response.Redirect "packsearch.asp" End If sql = "select username from USER where USERNAME = '" & LCase(username) & "'" sql = sql & " and PASSWORD = '" & LCase(userpwd) & "'" sql = sql & " and PACKFURN = 2" sql = sql & " and ACCLEVEL = 2" Set RS = Conn.Execute(sql) If RS.BOF And RS.EOF Then Else Session("UserLoggedIn") = "true" Response.Redirect "packsearch2.asp" End If sql = "select username from USER where USERNAME = '" & LCase(username) & "'" sql = sql & " and PASSWORD = '" & LCase(userpwd) & "'" sql = sql & " and SCREENNUM = 5" Set RS = Conn.Execute(sql) If RS.BOF And RS.EOF Then Else Session("UserLoggedIn") = "true" Response.Redirect "packsearch5.asp" End If End Sub %>