|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
prob.. in login page
hi..all of u....
i have made a login page in html page...in which two text field there..named username and password... i want to do the stuff that if the user enter correct username and password..then it displays a pop up window mentioning that u have successfully enetered and it then directly went into the mypage.jsp page...(targeted page) and if users enter wrong entry then it displays error in another page.. plz... do the needful for me....i am not getting any thing.... my code is as follow: try { String Username = request.getParameter("msno"); String Password = request.getParameter("pass"); sql = conn.prepareStatement("SELECT * FROM login_mast WHERE name = '" + Username + "' and password='"+Password+"' "); results = sql.executeQuery(); while(results.next()) { String Dbname = results.getString("name"); String Dbpassword = results.getString("password"); out.println("<TABLE >"); out.println("<TR>"); out.println("<TD><strong>Username</strong>:</TD>"); out.println("<TD><strong>Password</strong>:</TD></TR>"); out.println("<tr><td> <INPUT TYPE='TEXT' size='5' value='" + Dbname + "' readonly </td>"); out.println("<td> <INPUT TYPE='TEXT' size='5' value='" + Dbpassword + "' readonly </td></tr>"); } } catch (SQLException s) |
|
#2
|
||||
|
||||
|
Does your login code work and you want it to open in a popup instead of printing in the main window?
Or is your login code simply not working? |
|
#3
|
|||
|
|||
|
Quote:
yes my code doenot work...i want it to open in a popup and if login is correct then it directly went to correct page else error page. |
|
#4
|
||||
|
||||
|
Your code does not work.
Then the question is : what does not work ? Are you sure your connection with the database is all right. Your code does not mention how you implemented your connection. Next question : if you get a connection with the database, does the executeQuery return a resultset ? I advice you to put some System.out.println statements in it to be sure what is really happening. If you want to avoid these ugly System.out.println, try Log4J to have some logging. And last but not least : if you have this working, learn about the MVC or Model-View-Controller. It is good working practice to have the JSP's taking care of presentation only. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > prob.. in login page |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|