Advertisement
Guest User

Untitled

a guest
May 10th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.32 KB | None | 0 0
  1.  
  2.  
  3. <%@ page language="java" contentType="text/html; charset=windows-1255"
  4.    pageEncoding="windows-1255"%>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  6. <jsp:useBean id="db" class = "JDBC.ForDataBase"/><!-- equals to  "JDBC.ForDataBase db=new JDBC.ForDataBase()" -->
  7.  
  8. <html>
  9. <head>
  10. <style>
  11. h2{
  12. position: absolute;
  13. left:10px;
  14. top:800px;
  15. }
  16. form{
  17. text-align: center;
  18. }</style>
  19. <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
  20. <title>Loging</title>
  21. </head>
  22. <body style="background-image: url('http://www.cena.org.au/wp-content/uploads/2014/10/MEMBERS-ONLY-1.jpg')">
  23. <h2>
  24. <%= application.getAttribute("counter")%> :
  25.   באתר המבקרים מספר
  26. </h2>
  27. <%
  28.  
  29.     session.setAttribute("status","guest");
  30.      String n=request.getParameter("username");
  31.     String p=request.getParameter("password");
  32.    
  33.    
  34.     if(p!=null && n!=null)
  35.     {
  36.          session.setAttribute("username",n);
  37.          session.setAttribute("password",p);
  38.          if(n.equalsIgnoreCase("dan123") && p.equals("dan12345"))
  39.          {
  40.              session.setAttribute("status","admin");
  41.              response.sendRedirect("select.jsp");
  42.          }
  43.          else
  44.          {
  45.              String result[][] = db.select("select * from members where username='"+n+"' and password='"+p+"'");
  46.  
  47.              if(result.length>0)
  48.              {
  49.                  session.setAttribute("status","member");
  50.                  
  51.                  if (application.getAttribute ("counter") == null)
  52.                  {
  53.                  application.setAttribute("counter", 0);
  54.                  
  55.                  }
  56.                  int totalValue=(Integer)application.getAttribute("counter");
  57.                  application.setAttribute("counter", totalValue+1);
  58.                  response.sendRedirect("deleteForMember.jsp");
  59.              }
  60.  
  61.           }
  62.        
  63.        
  64.      }       
  65.     else
  66.     {
  67.      
  68. %>
  69.    <p style="position: absolute; top:1px; left: 10px;"><a href="MainPage.html"><img src="Homelink2.png" style="width:100px;height:100px ;"></a></p>
  70. <form action="login.jsp">
  71. <br><br><br><br><br><br><br><br><br><br><br><br>
  72.   Username:<br>
  73.   <input type="text" name="username"><br>
  74.   Password:<br>
  75.   <input type="password" name="password">
  76.   <br><br>
  77.   <input type="submit" name="Send">
  78.   <input type="reset" name="Delete">
  79. </form>
  80.    <%
  81.    }
  82.   %>
  83. </body>
  84. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement