Authentication Problem
Hi experts.
I have created a website with an auhentication feature. It had been working until i stopped IIS server one time and re-estarted, then authentication is not working at all. Without authentication, every thing is OK. I really WONDER :-).
This is the code of the loginverification.asp.
---------------------------------------------------------------------
<%
Dim strSQL
Dim objRS
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DSN=MyDB"
Set objRS = Server.CreateObject("ADODB.Recordset")
strSQL = "qparmVerify '" & CStr(Request.Form("txtname")) & _
"','" & CStr(Request.Form("txtpasswd")) & "'"
objRS.Open strSQL, objConn, adOpenForwardOnly, , adCmdStoredProc
If objRS.EOF or objRS.BOF Then
Session("ErrorMessage") = "No record found - Please ensure all information was entered correctly"
Response.Redirect "default.asp"
Else
Session("ErrorMessage") = Empty
End If
%>
<%
'Close and dereference database objects
'If IsObject(objRS) Then
objRS.Close
Set objRS = Nothing
'End IF
objConn.Close
Set objConn = Nothing
%>
<%
'Authenticate the user for other web pages
Session("Authenticated") = True
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE> Student's Web Site</TITLE>
</HEAD>
<BODY>
<div align=center>
<big><big>Student Registration Solution</big></big>
</div>
<br><br>
<%
Response.Redirect "Welcome.asp"
%>
</BODY>
</HTML>
--------------------------------------------------------------------
When the login submit button is pressed, then This code is called, so that it will verify against the DB. If wrong info is put in the login page, then this error will be printed: "No record found - Please ensure all information was entered correctly".
If the passwd and username are Ok, Then "Welcome.asp" will be forwarded.
My problem is that : It does print any thing with wrong pass/username, nor forward with right info.
If don't use any authentication, then i can access my website.
What is going on ???
Thanks in advance
|