Superdist Ltd - Mauritius: Wholesaler for HP, Fujitsu-Siemens Computers, Unitek UPS Systems & Compaq
<%
If Request.QueryString("log") = "off" Then
Session("LoggedIn") = False
Session("ID") = ""
Session.Abandon()
Response.Redirect("default.aspx")
End If
If Request.Form("btn_submit") = "Submit" Then
If Request.Form("username") <> "" And Request.Form("pwd") <> "" Then
Dim MyConnection As Oledb.OleDbConnection
Dim DataLogin As Oledb.OleDbDataReader
MyConnection = New Oledb.OleDbConnection(System.Configuration.ConfigurationSettings.AppSettings("MyConn"))
Dim CmdLogin As New Oledb.OleDbCommand("qryLogin", MyConnection)
CmdLogin.CommandType = CommandType.StoredProcedure
CmdLogin.Parameters.Add(New Oledb.OleDbParameter("@login", SqlDbType.nVarChar, 200))
CmdLogin.Parameters("@login").Value = CStr(Request.Form("username"))
CmdLogin.Parameters.Add(New Oledb.OleDbParameter("@pass", SqlDbType.nVarChar, 200))
CmdLogin.Parameters("@pass").Value = CStr(Request.Form("pwd"))
MyConnection.Open()
DataLogin = CmdLogin.ExecuteReader()
If DataLogin.Read() Then
If DataLogin("Login") = CStr(Request.Form("username")) And DataLogin("Pwd") = CStr(Request.Form("pwd")) Then
Session("LoggedIn") = True
Session("ID") = DataLogin("Title") & " " & DataLogin("Surname")
Session("SessID") = DataLogin("MemberID")
Session.Timeout = 400
strstatus = "Successful login"
AddTracking()
Response.Redirect("member_area.aspx")
Else
lblerror.Text = "Invalid Login. Please try again !"
strstatus = "Invalid login"
AddTracking()
End If
Else
Session("LoggedIn") = False
strstatus = "Invalid login"
AddTracking()
lblerror.Text = "Invalid Login. Please try again !"
End If
DataLogin.Close()
CmdLogin.Dispose()
MyConnection.Close()
End if
End if
%>