Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page language="java" contentType="text/html; charset=windows-1255"
- pageEncoding="windows-1255"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <jsp:useBean id="db" class = "JDBC.ForDataBase"/><!-- equals to "JDBC.ForDataBase db=new JDBC.ForDataBase()" -->
- <html>
- <head>
- <style>
- h2{
- position: absolute;
- left:10px;
- top:800px;
- }
- form{
- text-align: center;
- }</style>
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
- <title>Loging</title>
- </head>
- <body style="background-image: url('http://www.cena.org.au/wp-content/uploads/2014/10/MEMBERS-ONLY-1.jpg')">
- <h2>
- <%= application.getAttribute("counter")%> :
- באתר המבקרים מספר
- </h2>
- <%
- session.setAttribute("status","guest");
- String n=request.getParameter("username");
- String p=request.getParameter("password");
- if(p!=null && n!=null)
- {
- session.setAttribute("username",n);
- session.setAttribute("password",p);
- if(n.equalsIgnoreCase("dan123") && p.equals("dan12345"))
- {
- session.setAttribute("status","admin");
- response.sendRedirect("select.jsp");
- }
- else
- {
- String result[][] = db.select("select * from members where username='"+n+"' and password='"+p+"'");
- if(result.length>0)
- {
- session.setAttribute("status","member");
- if (application.getAttribute ("counter") == null)
- {
- application.setAttribute("counter", 0);
- }
- int totalValue=(Integer)application.getAttribute("counter");
- application.setAttribute("counter", totalValue+1);
- response.sendRedirect("deleteForMember.jsp");
- }
- }
- }
- else
- {
- %>
- <p style="position: absolute; top:1px; left: 10px;"><a href="MainPage.html"><img src="Homelink2.png" style="width:100px;height:100px ;"></a></p>
- <form action="login.jsp">
- <br><br><br><br><br><br><br><br><br><br><br><br>
- Username:<br>
- <input type="text" name="username"><br>
- Password:<br>
- <input type="password" name="password">
- <br><br>
- <input type="submit" name="Send">
- <input type="reset" name="Delete">
- </form>
- <%
- }
- %>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement