<%@LANGUAGE="VBSCRIPT"%> <% Option Explicit %> <% dbConnect dim loginFailed, userExists dim sKey, decPass loginFailed = false userExists = false Sub ValidateUser() If isEmpty(Request.Form("submit")) Then If Len(Request.QueryString("userID")) > 0 Then Response.Write " value='"& Request.QueryString("userID") &"'" Elseif len(Session("action")) > 0 and len(Session("UserID")) > 0 Then sqlQuery = "SELECT Email FROM login WHERE id='"& Session("UserID") &"'" Set rsResult = executeQuery(sqlQuery) Response.Write " value='"& rsResult("Email") &"'" End If Else If userExists Then Response.Write " value='" & Request.Form("eMail") & "'" End If End Sub Sub ValidatePassword() If (isEmpty(Request.Form("submit"))) And (Len(Request.QueryString("userID"))>0) Then sKey = Split(Request.QueryString("userID"), "@") decPass = EncryptText(sKey(0), Request.QueryString("pass")) Response.Write " value='" & decPass & "'" End If End Sub If Not isEmpty(Request.Form("submit")) Then sqlQuery = "SELECT * FROM login WHERE Email='" & Request.Form("eMail") & "' and Password='" & Request.Form("passWord") & "'" Set rsResult = executeQuery(sqlQuery) If Not rsResult.EOF Then Session.Timeout = 1 Session("Name") = rsResult("FirstName") & " " & rsResult("LastName") Session("Email") = Request.Form("eMail") Session("userID") = rsResult("id") If Request.Form("storeCookie") = "checked" Then Response.Cookies("Login")("Name") = Session("Name") Response.Cookies("Login")("Email") = Session("Email") Response.Cookies("Login")("userID") = Session("userID") Response.Cookies("Login").Expires = now() + 30 End If Response.Redirect "quote.asp" Else loginFailed = true sqlQuery = "SELECT * FROM login WHERE Email='" & Request.Form("eMail") & "'" Set rsResult = executeQuery(sqlQuery) If Not rsResult.EOF Then userExists = true End If End If %> Login - Automated Quote - AAA Budget Websites

<% if loginFailed then Response.Write "Login failed due to the following reason:
" if userExists then Response.Write "Incorrect password!
" Response.Write "Please re-enter your password and try again.
" Response.Write "If you forgot your password please contact our support team to have it reset." else Response.Write "User does not exists!
" Response.Write "Please check your email address and try again." end if Response.Write "

" end if %> <% if Session("action") = "post registration" then %> <% else %> <% end if %>

Success

Your login information
has been emailed to you

Please fill in missing fields
to continue your quote

New Users


Take advantage of our
Automated Quote System


Start

Existing users
Please enter your Email & Password
Email: >
Password: >
>  Remember me on this computer