Guest User

Google Chrome

a guest
Apr 7th, 2019
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. <%@ page language="java" contentType="text/html; charset=windows-1255"
  2. pageEncoding="windows-1255"%>
  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  4.  
  5. <jsp:useBean id="db" class = "JDBC.ForDataBase"/>
  6. <!-- equals to "JDBC.ForDataBase db=new JDBC.ForDataBase()" -->
  7. <html>
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
  10. <title>select</title>
  11. </head>
  12. <body style="background-image: url(background.jpg);">
  13. <jsp:include page="menu.jsp"></jsp:include>
  14.  
  15. <h2><font color="green">Show Member's Details </font></h2>
  16. <form action="selectForMember.jsp" method="post">
  17. <font color="black">Name: <input type="text" id="username" name="username"></font>
  18. <font color="black">Password: <input type="text" id="password" name="password"></font>
  19. <input type="submit" value="submit"></form>
  20. <%
  21.  
  22. if(request.getMethod().equals("POST"))
  23. {
  24. String username=request.getParameter("username");
  25. String password=request.getParameter("password");
  26. String result[][] = db.select("select * from gmembers where username='"+username+"' and password='"+password+"'");
  27. %>
  28. <table border="2" bordercolor="red" align="center" bgcolor="gold" width="80%" height="100">
  29. <tr>
  30.  
  31. <th>firstname</th>
  32. <th>lastname</th>
  33. <th>email</th>
  34. <th>username</th>
  35. <th>password</th>
  36. <th>age</th>
  37.  
  38.  
  39. </tr>
  40. <tr>
  41. <%
  42.  
  43.  
  44. int j,i;
  45. for(i=0;i<result.length;i++)
  46. {
  47.  
  48. out.println("<tr>");
  49. for(j=0;j<result[i].length;j++)
  50. {
  51.  
  52. out.println("<td>"+result[i][j]+"</td>");
  53. }
  54. out.println("</tr>");
  55. }
  56.  
  57. }
  58. %>
  59. </tr>
  60. </table>
  61. <form method="get" action="main.html"><button type="submit" style="background-color:lightblue;font-weight: bold;">back to main</button></form>
  62. </body>
  63. </html>
Add Comment
Please, Sign In to add comment