I am using User authentication system, which uses 2 pages index.asp where user logs in and then the username and password is sent to the validate.asp page where it is checked against database userlist.
if username and password are matched with username and password of database record then it should redirect to new page main.asp
but it is just throwing back to index.asp
index.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W5C//DTD XHTML 1.0 Transitional//EN" "http://www.w5.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w5.org/1999/xhtml">
<SCRIPT SRC="Z:\demographics\boxover.js"></SCRIPT>
<head>
<!--<META HTTP-EQUIV=REFRESH CONTENT="5;URL=http://www.ualr.edu/human_relations/demographics/applicant-tracking-data.asp">-->
<title>Office of Human Relations - University of Arkansas at Little Rock</title>
<!--#include virtual="/human_relations/assets/includes/custom_head_onecolumn.inc" -->
<div id="contentcenteronecolumn">
<h3><p align="center">Online Recruitment Process</p></h3><br/><br/>
</head>
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"georgia";
mso-fareast-font-family:"Times New Roman";}
p
{font-size:10.0pt;
font-family:"georgia";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
tab-interval:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
.in {
font-size:10.0pt;
font-family:"georgia";
mso-fareast-font-family:"Times New Roman";
}
.error { color: red; }
</style>
<style type="text/css">
body {
georgia, Helvetica, sans-serif;
font-size: 12px;
}
</style>
<!--<p>
Please review the <a href="http://www.ualr.edu/human_relations/recruitment/optiona.asp">Recruitment Guidelines</a> prior to logging in.
</p>-->
<p align="center"><span class="in">First time users must</span> <a href="/human_relations/phaseI/create.asp">Register</a>
</p></font>
<!--<p><span class="teenI">Login using your FACSTAFF domain username & create unique password.
</span></p>-->
<form action="validate.asp" method="POST" name="form1">
<table border=0 cellpadding=0 cellspacing=0 width=95%>
<tr align="left">
<td valign="top">
<br>
<div align="center">
<span class="teenI"><a href=http://www.ualr.edu/human_relations/phaseI/update.asp>Change Password</a></span>
</div>
<br/>
<td valign="top">
<br>
<div align="center">
<span class="teenI"> <a href="/human_relations/">Human Relations</a></span>
</div>
<!--<table border=0 style="margin-left: 50px;">-->
<table border=0 cellpadding=0 cellspacing=0 width=85%>
<%if message <> "" then%>
<tr><td colspan="2"><strong><%=message%></strong></td></tr>
<%end if%><br/>
<tr><td>Username:</td><td><input type="text" name="txtName"></td></tr>
<tr><td>Password:</td><td><input type="password" name="txtPassword"></td></tr>
<input type="submit" value="Submit"></td></tr>
<tr><td colspan="2"> </td></tr>
<tr><td colspan="2"><span class="teenI">Forgot password or username e-mail: humanrelations@ualr.edu</span></td></tr>
</table>
</table>
</form>
</div>
<script>document.form1.username.focus()</script>
<%
End If
%>
<!--#include virtual="/ualr_assets/includes/footer.inc" -->
</html>
validate.asp
<%
'Read in the password and username from the form
Dim strUserName, strPassword
strUserName = Request.form("txtName")
strPassword = Request.form("txtPassword")
'Establish a database connection...
Dim sConString
sConString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("project.mdb") & ";"
Set rsCHECK = Server.CreateObject("ADODB.Recordset")
sSQLString = "SELECT * from userlist WHERE username='" & strUserName & "' and userpassword='" & strPassword & "'"
rsCHECK.Open sSQLString, sConString, 0, 1
If rsCHECK.EOF Then
userloggedin=false
else
userloggedin=true
End If
If userloggedin=true Then
Response.redirect("main.asp")
Else
response.write "No record with specified ID was found. Please try again.<br /><a href='index.asp'>Return to Login</a>"
End If
%>