here is the code that can help you in designing the login page for the users. It is well commented so I think you will have no problem in understanding that.
<%
Dim adoConn 'Database Connection Variable
Dim rsCheckUser 'Database Recordset Variable
Dim strSQL 'Database query sring
Dim strUserName 'Holds the user name
Dim strPassword 'Holds the Password
'Initalise the strUserName variable
strUserName = Request.Form("UserName")
strPassword = Request.Form("Passowrd")
'Create a connection odject
Set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.Open "Driver={MySql ODBC 3.51 Driver}; Server=localhost; database=slogin; uid=user
'Create a recordset object
Set rsCheckUser = Server.CreateObject("ADODB.Recordset")
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT UserName, Password FROM tblUsers WHERE UserName ='" & strUserName & "'"
'Query the database
rsCheckUser.Open strSQL, adoConn
'If the recordset finds a record for the username entered then read in the password for the user
If NOT rsCheckUser.EOF Then
'Read in the password for the user from the database
If (strPassword) = rsCheckUser("Password") Then
'If the password is correct then set the session variable to True
Session("LoggedIn") = True
'Close Objects before redirecting
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing
'Redirect to the authorised user page and send the users name
Response.Redirect "loggedin.asp"
End If
End If
'Close Objects
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing
'If the script is still running then the user must not be authorised
Session("LoggedIn") = False
'Redirect to the unautorised user page
Response.Redirect "login.asp"
%>
Reputation Points: 9
Solved Threads: 1
Junior Poster in Training
Offline 91 posts
since Sep 2004