swstos
03-13-2003, 05:36 PM
hi...
i am trying to make web pages protected.
I have a table which has the usernames and passwords.
I created the login screen and in another web page (called authentication) i wrote the code to compare the username and password of the login screen with those in the database.
But something goes wrong and is doing nothing.
The code i wrote in the authentication.asp is below:
<%
Dim strUsername, strPassword
strUsername = Request("username")
strPassword = Request("password")
Dim rsUsers
set rsUsers = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM admin WHERE name = '" & strUsername & "';"
rsUsers.Open strSQL, objConn
WHILE NOT rsUsers.EOF
' if doctor's login details found
If rsUsers("name") = Request.form("strUsername") THEN
Response.Redirect "memberpage.asp"
Else
Response.Write "Access Denied!"
END IF
WEND
%>
can please anyone tell me what is wrong...? :confused:
i am trying to make web pages protected.
I have a table which has the usernames and passwords.
I created the login screen and in another web page (called authentication) i wrote the code to compare the username and password of the login screen with those in the database.
But something goes wrong and is doing nothing.
The code i wrote in the authentication.asp is below:
<%
Dim strUsername, strPassword
strUsername = Request("username")
strPassword = Request("password")
Dim rsUsers
set rsUsers = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM admin WHERE name = '" & strUsername & "';"
rsUsers.Open strSQL, objConn
WHILE NOT rsUsers.EOF
' if doctor's login details found
If rsUsers("name") = Request.form("strUsername") THEN
Response.Redirect "memberpage.asp"
Else
Response.Write "Access Denied!"
END IF
WEND
%>
can please anyone tell me what is wrong...? :confused: