while(rs.next())
{
if((rs.getString("m_emp_no").equals(user)) && (rs.getString("m_password").equals(pwd)) )
{
" " direct to some page
}
else
{
<script language="javascript">
alert("Sorry!Wrong User ID or Password entered.Try Again");
document.f1.action="loginpage"
document.f1.submit();
}
}
I notice the following problems :-
- First no indentations
- Next I do not know where does this code go, is it inside a servlet or inside a JSP page, either way you should get an error cause you are directly mixing html with java code without appropriate delimiters
- And the code you are using to redirect you have completely skipped it from what can be seen, which is from your description appears to be where the problem lies.
Last edited by stephen84s; Aug 27th, 2008 at 6:31 am.
Reputation Points: 653
Solved Threads: 151
Nearly a Posting Virtuoso
Offline 1,316 posts
since Jul 2007