• Post Reply Bookmark Topic Watch Topic
  • New Topic

Login Validation

 
Nico Yukiko
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My code below don't validate from the database whether it is a valid user.WHY??It just print the Hi and the name.???


(Marilyn added code tags)
[ September 01, 2005: Message edited by: Marilyn de Queiroz ]
 
Choon-Chern Lim
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At a glance, it looks okay to me.

Do you get any sql exceptions? Is your ResultSet always empty?

By the way, it's preferable to use preparedStatement because in your code, if my password is "' or 1=1", I think I can mess up your stuff, where else in preparedStatment, the input strings are masked.

Also, it is a good practice to close your resultset too.
 
Lee Barney
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks to me like you are over using the <html><body></body></html> tags. You really should only have one of each of these in your generated html code. You appear to be adding muliple copies of these in your resulting page. Check the source of your generated page in your browser to see what is actually on the page. Don't rely on what you see within the browser. It can be misleading.
 
Anoop Kavalloor
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with LEE. you can't have more than one <HTML><BODY></BODY></HTML> tag in a single page. just keep a single set of the above mentioned tag. In your check() , just add the <H2> tag.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unqualified Genius,

It appears that you have a lot of knowledge about Servlet programming and and are capable of contributing a lot to this forum. I hope that you will conform to the Javaranch naming policy as David has requested in several threads so that your account will remain open.

Looking forward to your future contribution.
-Ben
[ September 05, 2005: Message edited by: Ben Souther ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!