<%@ Language = "VBScript" %> <% Option Explicit '********************************************************** ' To make this script work you simply need to create a ' table named tblLoginInfo in your database with one ' column named username and another named password. Put ' the values you want for username and password into a ' record in the table. The advantages of this script are ' that it's more secure than if you hard-coded the ' username/password values directly in the script, and ' that you can change the username and password simply by ' changing the values in your login_table. ' ' NOTE: BE SURE TO EITHER MOVE THE INCLUDED SAMPLE ' DATABASE TO A SECURE AREA OUTSIDE THE WEB SITE OR ' USE A DIFFERENT SECURE DATABASE. OTHERWISE ANYONE ' CAN SIMPLY DOWNLOAD THE WHOLE DB AND RETREIVE YOUR ' USERNAME AND PASSWORD FROM IT. '********************************************************** Dim cnnLogin Dim rstLogin Dim strUsername, strPassword Dim strSQL %> American Online Imports - Document downloads <% If Request.Form("action") <> "validate_login" Then %>







AOI Login - V1
Username:
Password:
 
<% Else strSQL = "SELECT * FROM tblLoginInfo " _ & "WHERE username='" & Replace(Request.Form("login"), "'", "''") & "' " _ & "AND password='" & Replace(Request.Form("password"), "'", "''") & "';" Set cnnLogin = Server.CreateObject("ADODB.Connection") cnnLogin.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _ & "DBQ=" & Server.MapPath("aoi_DATABASE/americanonlineimports_69.mdb")) Set rstLogin = cnnLogin.Execute(strSQL) If Not rstLogin.EOF Then %> Redirect









YOU ARE BEING REDIRECTED IN (2) SECONDS TO
AOI MEMBERS AREA (Document Downloads)
<% Else %>








Login Failed! <Try Again>
ERROR

<% 'Response.End End If ' Clean Up rstLogin.Close Set rstLogin = Nothing cnnLogin.Close Set cnnLogin = Nothing End If %>