i dont understant why its not going inside "error_01 or error_02" if statment?
if user enter username and hit sumbit than it goes in "worked" if statment
but if user dont enter any thing in usrname it still go in "worked" if statment.
<!-- login form -->
<form method ="POST" action ="login.jsp">
Enter username:
<input name="username" />
Enter password:
<input name="password" />
<button type="submit" name="login">login</button>
</form>
<%
if (request.getParameter("login") != null)
{
String username = request.getParameter("username");
String password = request.getParameter("password");
if(username == null)
{
out.print("error_01");
}
else if (password == null)
{
out.print("error_02");
}
else
{
out.print("worked");
}
}
%>