|
| |
<%
' Create a command object. This object serves to run our queries
Set Cm = Server.CreateObject("ADODB.Command")
' Specify the system DSN path
Cm.ActiveConnection = "LoginDSN"
' Now it's time for the query. We need to check the user information
' against the table tUsers
Cm.CommandText = "SELECT * FROM tUsers WHERE " & _
"UserName='" & Request.Form("UserName") & "' AND " & _
"UserPassword='" & Request.Form("UserPassword") & "' "
' Set the query type. 1 means it is a SQL statement
Cm.CommandType = 1
' Retrieve the results in a recordset object
Set Rs = Cm.Execute
' We now check if the user is valid. If user is valid, the recordset MUST
' haverecord. Otherwise it is empty. If user exists, we set authentication
' status to 1 and send the user to appropriate page, say welcome.asp.
' Else send the user back to login.asp
If Rs.EOF Then
Session("Authenticated") = 0
Response.Redirect ("login.asp")
Else
Session("Authenticated") = 1
Response.Redirect ("welcome.asp")
End If
%>
| |
| With thanks
to our Supporters |
| |
 |
| |
|
| |
|
| |
 |
|
|
|
|
|
|
|
|
|
|