i want to built up a simple login page. what i do is just let user to key in the username and password then will compare to the database . after compare if the username and password valid then direct to the specific. wat the code to use for direct the link automatically without clicking after validation....
I'm assuming you are using a html/jsp page to take the login information. When the user click on the submit button, you could then use the POST method to post to a JSP or Servlet.
After you post the login information to a jsp, you could get the username and password from the request:
In your jsp page you could then validate the information against the database. If the user enter correct password then you redirect to a secured page, otherwise, you can just redirect to a invalid HTML page, or redirect back to the login page.
It would be helpful if you can look up Model View Controller pattern(MVC) for doing this kind of thing to separate View(Login Page) from the business logic(Login Validation).
I didn't give you the complete code, but this is the general flow that you can follow.
Good luck! [ February 23, 2007: Message edited by: Eric C Lee ]