Chandrasekar Chandrasekar - 12 days ago 7
Javascript Question

Case sensitivity in password validation in login form

I have a login form, i am done with connecting to DB, everything works fine. I have a username = a and password = b in my DB. During login if i enter "B" in password, i am able to login, can some one help me out with validating that password field. Thx in advance.
The JSP code is as follows:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

</head>
<body bgcolor="#FFCC66">
<center>
<h1>Login</h1>
</center>
<form action="CommonLog" method="post">
<center>
<table align="center">
<tr>
<td><font style="font-size: 20px">Name</font></td>
<td><input type="text" name="name" style="width: 228px; height: 34px;"/></td>
</tr>
<tr>
<td><font style="font-size: 20px">Password</font></td>
<td><input type="password" name="pass" style="width: 229px; height: 36px"/></td>
</tr>
<tr>
<td>
<td><input type="submit" value="Login"
style="width: 88px; height: 41px; font-size: 15px" /></td>
</tr>
</table>
</center>
</form>
</body>
</html>

Answer

Your Password matching criteria can be

sending the username and password to db directly and then matching your data or

retrieving data from the table completly and then matching data.