Advertisement
Guest User

LoginIdo

a guest
Mar 24th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 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" "http://www.w3.org/TR/html4/loose.dtd">
  4. <jsp:useBean id="db" class = "JDBC.ForDataBase"/><!-- equals to "JDBC.ForDataBase db=new JDBC.ForDataBase()" -->
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
  8. <title>Login</title>
  9. <style>
  10. body {
  11. font-family: "Comic Sans MS", cursive, sans-serif;
  12. background: grey;
  13. }
  14. .comic{
  15. font-family: "Comic Sans MS", cursive, sans-serif;
  16. color: black;
  17. }
  18. .button {
  19. background-color: #D4AF37;
  20. color: white;
  21. padding: 15px 25px;
  22. text-align: center;
  23. font-size: 16px;
  24. cursor: pointer;
  25. display:inline-block;
  26. border-style: groove;
  27. border-width: 7px;
  28. border-color: coral;
  29. }
  30. .button:hover {
  31. background-color: #A47F07;
  32. border-style: groove;
  33. border-width: 7px;
  34. border-color: coral;
  35. }
  36. input[type=submit] {
  37. width: 12%;
  38. background-color: #D4AF37;
  39. color: black;
  40. font-family: "Comic Sans MS", cursive, sans-serif;
  41. font-size: 16px;
  42. padding: 14px 20px;
  43. margin: 8px 0;
  44. border-style: groove;
  45. border-width: 7px;
  46. border-color: coral;
  47. border-radius: 4px;
  48. cursor: pointer;
  49. }
  50. input[type=submit]:hover {
  51. background-color: #A47F07;
  52. border-style: groove;
  53. border-width: 7px;
  54. border-color: coral;
  55. color: black;
  56. font-family: "Comic Sans MS", cursive, sans-serif;
  57. font-size: 16px;
  58. padding: 14px 20px;
  59. margin: 8px 0;
  60. border-style: groove;
  61. border-width: 7px;
  62. border-color: coral;
  63. border-radius: 4px;
  64. }
  65.  
  66.  
  67. </style>
  68. </head>
  69. <div class=comic>
  70. <center>
  71. <h1 style="font-size:100px;"> Login</h1>
  72. <body style="background-image: url('green background2.jpg')">
  73. <jsp:include page="menu.jsp"></jsp:include>
  74.  
  75. <%
  76.  
  77. session.setAttribute("status","guest");
  78. String n=request.getParameter("UserName");
  79. String p=request.getParameter("pass");
  80.  
  81.  
  82. if(p!=null && n!=null)
  83. {
  84. session.setAttribute("UserName",n);
  85. session.setAttribute("pass",p);
  86. if(n.equals("ido") && p.equals("2003"))
  87. {
  88. session.setAttribute("status","menahel");
  89. }
  90. else
  91. {
  92. String result[][] = db.select("select * from members where UserName='"+n+"' and Password='"+p+"'");
  93. if(result.length>0)
  94. session.setAttribute("status","member");
  95.  
  96. }
  97.  
  98.  
  99. }
  100. else
  101. {
  102.  
  103. %>
  104. <form action="login.jsp" method="post">
  105. <table>
  106. <tr><td>UserName:<td><input type="text" name="UserName" ></td></tr>
  107. <tr><td>Password:</td><td><input type="Password" name="pass" ></td></tr>
  108. </table>
  109. <input type="submit" value="Submit">
  110. </form>
  111. </center>
  112. </div>
  113. <%
  114. }
  115. %>
  116. </body>
  117. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement