I have an online login (username/password) form which, even if I log-in with the correct credentials, tells me that I have the wrong username/password.
The form is in a file called 'Dimalogin1.asp'. The form posts to submit1.asp which looks like this:
Code: Select all
<% @LANGUAGE=VBScript %>
<%
Dim Conn, sql, rs
If IsObject( Session( "Conn" ) ) Then
Set Conn = Session( "Conn" )
Else
set Conn = server.createobject("adodb.connection")
constr = "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=" & "E:\myDatabase.mdb"
Conn.open constr
Set Session( "Conn" ) = Conn
End If
sql = "SELECT * FROM userlist"
Set rs = Server.CreateObject( "ADODB.Recordset" )
rs.Open sql, Conn
rs.MoveFirst()
While Not rs.EOF
If Lcase(Request( "id" )) = Lcase(rs( "username" )) AND Request( "Pwd" ) = rs( "password" ) Then
Session( "loginfailure" ) = False
Session( "login" ) = 1
Session( "final" ) = true
Session( "user" ) = Request( "id" )
Call Response.Redirect( "finalpage1.asp" )
End If
rs.MoveNext()
Wend
Session( "loginFailure" ) = True
Session( "login" ) = -1
Call Response.Redirect( "Dimalogin1.asp" )
%>
Thanks!
Blue