<% dim username dim pass dim msg dim checked username = Request.Form("username") password = trim(Request.Form("password")) if request.Form("Login")="Login" then strSQL = "Select * FROM clients WHERE userID= '" & username & "'" rs.Open strSQL, strCon if not rs.eof then dim pwd pwd = password & rs("Salt") if HashEncode(pwd) = rs("Password") then if rs("accept")= "No" then response.redirect("register.asp?Err=Account Not%20Yet%20Confirmed. %20Please%20await confirmation") days=calculatedays(rs("AMC_expiry")) if days<0 then response.redirect("register.asp?Err=AMC%20Expired") session("KPID") = Session.SessionID session("KPADM") = rs("Name") session("KPLD") = now session("days") = days session("loginOK") = "true" session("productID") = rs("product") session("User_email") = rs("email") ' session("KPUT") = rs("Type") response.redirect("index.asp") else response.redirect("register.asp?Err=Wrong%20Password") session("KPADM") = "" session("KPLD") = "" end if else response.redirect("register.asp?Err=User%20not%20found") end if End if if request.QueryString("cmd") = "logout" then session("KPADM") = "" session("KPLD") = "" session("KPID") = "" session("LoginOK")="" response.redirect("register.asp?Err=Successfully%20Logged%20Out") End if %>