| | |
problem with password validation
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2008
Posts: 50
Reputation:
Solved Threads: 0
hello,
I just noticed a problem in my code.
hope you'll would help me.
normally we have a login page where the userid and password is validated from database .now the problem what i am facing is
now the code is working fine to log in to the main page but when i type any user id or password in the text box then it doesnt direct me to the alert box else it just shows me a blank page.for example if my password is "welcome" in database and i type "Welcome" which is in caps then it prompts me the alert box but if it type "hello123" then it doesnt prompt me the alert box.i really dont understand what is the problem.i even tried with this code
here it directs me to the alert box if i put any password wrong, but here the problem is if the password column in database is in caps such as "Welcome" and in the page if i insert "welcome" in lower case still it accepts and direct me to the main page which shouldnt happen.so pls anyone could help me out of this .if the question is not clear pls ask me to send it again.
thanks in advance.
I just noticed a problem in my code.
hope you'll would help me.
normally we have a login page where the userid and password is validated from database .now the problem what i am facing is
JSP Syntax (Toggle Plain Text)
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(); } }
now the code is working fine to log in to the main page but when i type any user id or password in the text box then it doesnt direct me to the alert box else it just shows me a blank page.for example if my password is "welcome" in database and i type "Welcome" which is in caps then it prompts me the alert box but if it type "hello123" then it doesnt prompt me the alert box.i really dont understand what is the problem.i even tried with this code
JSP Syntax (Toggle Plain Text)
if(rs.next()==true) { } else if(rs.next()==false) { javascript }
thanks in advance.
Last edited by peter_budo; Aug 26th, 2008 at 7:46 am. Reason: Keep It Organized - please use [code] tags
JSP Syntax (Toggle Plain Text)
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(); } }
- 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.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
![]() |
Similar Threads
- help me solve my virus problem (Viruses, Spyware and other Nasties)
- more problem!!!! (Windows Software)
- For Lianne: Hotmail problem- possible virus? (Viruses, Spyware and other Nasties)
- friends problem, HJT log (Viruses, Spyware and other Nasties)
- about:blank Trusted Start Page problem (Viruses, Spyware and other Nasties)
Other Threads in the JSP Forum
- Previous Thread: Hibernate tutorial
- Next Thread: LoginScript using JSP-Session
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web






