<%@ LANGUAGE="VBSCRIPT" %> <% Response.Expires = -1000 'Makes the browser not cache this page Response.Buffer = True 'Buffers the content so our Response.Redirect will work %> Personal Assistant Registry Logon Page <% Dim Error_Msg dim datelogin login = Request.Form("login") If login = "login_again" Then Session("pcaUserLoggedIn") = "" ShowLogin Else If Session("pcaUserLoggedIn") = "true" Then AlreadyLoggedIn Else If login = "true" Then CheckLogin Else ShowLogin End If End If End If Sub ShowLogin Response.Write(Error_Msg & "
") %>
Personal Assistant Registry Logon Page.
User Name :
 
Password :
 
 
You Must be registered To View The PAS Registry Click Here To Register
Forgot Your Password? Click Here
<% End Sub Sub AlreadyLoggedIn %>
Personal Assistant Registry Logon Page.
You are already logged in. Do you want to logout and login as a different user?
<% End Sub sub LogLogin username = session("username") userpwd = session("userpwd") Dim objRaj Set objRaj = Server.CreateObject("ADODB.Recordset") 'open the database table UserLog objRaj.Open "pcaUserLog", strConnect, adOpenStatic, _ adLockOptimistic, adCmdTable 'create a new record objRaj.AddNew 'set the field equal to the variable objRaj("Username") = username objRaj("Userpwd") = userpwd objRaj("DateLogin") = datelogin 'update the database with the new record objRaj.Update 'close the database objRaj.Close Set objRaj = Nothing end sub Sub CheckLogin Dim Conn, sql, RS, username, userpwd username = Request.Form("username") userpwd = Request.Form("userpwd") session("username") = username session("userpwd") = userpwd Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open strConnect 'sql = "select username from UserTable where username = '" & LCase(username) & "'" 'sql = sql & " and userpwd = '" & LCase(userpwd) & "'" sql = "select username from intakeform where username = '" & LCase(username) & "'" sql = sql & " and password = '" & LCase(userpwd) & "'" Set RS = Conn.Execute(sql) If RS.BOF And RS.EOF Then Error_Msg = "Login Failed. Try Again." ShowLogin ' response.write "UserName = "&username & " and Password = " &userpwd ' response.write "
"&sql Else Datelogin = Now LogLogin Session("pcaUserLoggedIn") = "true" Response.Redirect "pas.asp" End If session("username") = "" session("userpwd") = "" End Sub %>