%@LANGUAGE="VBSCRIPT"%>
<%
If Request.servervariables("REQUEST_METHOD") = "POST" Then
'Define Delphic Connection
MM_dis1_STRING = "Driver={Microsoft Access Driver (*.mdb)};Dbq=D:\\ClientApps\\DelData97.mdb;Uid=;Pwd;"
'Define AWS Connection
'DO NOT REMOVE
'filePath = Server.MapPath("/DelData97.mdb")
'MM_dis1_STRING = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & filePath & ";"
UserID=replace(replace(replace(""&request.form("userid"),"'","''"),"--",""),"password","")
Password=replace(replace(replace(""&request.form("password"),"'","''"),"--",""),"password","")
SQL = "SELECT userID FROM websecurity where WebSecurity.userID='" & userID & "' and WebSecurity.password = '" & password & "'"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open MM_dis1_STRING
set RS = Server.CreateObject("ADODB.Recordset")
RS.open SQL,Conn
If not rs.eof then
Session("MM_Username") = UserID
userID = rs("userID")
rs.close
SQL = "Select accounttype from customers where customerID = " & userID
RS.open SQL,Conn
if not rs.eof then
if ucase(rs("accounttype")) = "PI" then
REDIRECT = "dis_form_main_menu_PI.asp"
else
REDIRECT = "dis_form_choose_one.asp"
end if
else
message = "Username and/or Password Invalid."
end if
else
message = "Username and/or Password Invalid."
end if
'CLEAN UP!!
rs.close
set rs=nothing
conn.close
set conn=nothing
if redirect <> "" then
response.redirect REDIRECT
end if
end if
%>