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>
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
- <title>Login</title>
- <style>
- body {
- font-family: "Comic Sans MS", cursive, sans-serif;
- background: grey;
- }
- .comic{
- font-family: "Comic Sans MS", cursive, sans-serif;
- color: black;
- }
- .button {
- background-color: #D4AF37;
- color: white;
- padding: 15px 25px;
- text-align: center;
- font-size: 16px;
- cursor: pointer;
- display:inline-block;
- border-style: groove;
- border-width: 7px;
- border-color: coral;
- }
- .button:hover {
- background-color: #A47F07;
- border-style: groove;
- border-width: 7px;
- border-color: coral;
- }
- input[type=submit] {
- width: 12%;
- background-color: #D4AF37;
- color: black;
- font-family: "Comic Sans MS", cursive, sans-serif;
- font-size: 16px;
- padding: 14px 20px;
- margin: 8px 0;
- border-style: groove;
- border-width: 7px;
- border-color: coral;
- border-radius: 4px;
- cursor: pointer;
- }
- input[type=submit]:hover {
- background-color: #A47F07;
- border-style: groove;
- border-width: 7px;
- border-color: coral;
- color: black;
- font-family: "Comic Sans MS", cursive, sans-serif;
- font-size: 16px;
- padding: 14px 20px;
- margin: 8px 0;
- border-style: groove;
- border-width: 7px;
- border-color: coral;
- border-radius: 4px;
- }
- </style>
- </head>
- <div class=comic>
- <center>
- <h1 style="font-size:100px;"> Login</h1>
- <body style="background-image: url('green background2.jpg')">
- <jsp:include page="menu.jsp"></jsp:include>
- <%
- session.setAttribute("status","guest");
- String n=request.getParameter("UserName");
- String p=request.getParameter("pass");
- if(p!=null && n!=null)
- {
- session.setAttribute("UserName",n);
- session.setAttribute("pass",p);
- if(n.equals("ido") && p.equals("2003"))
- {
- session.setAttribute("status","menahel");
- }
- else
- {
- String result[][] = db.select("select * from members where UserName='"+n+"' and Password='"+p+"'");
- if(result.length>0)
- session.setAttribute("status","member");
- }
- }
- else
- {
- %>
- <form action="login.jsp" method="post">
- <table>
- <tr><td>UserName:<td><input type="text" name="UserName" ></td></tr>
- <tr><td>Password:</td><td><input type="Password" name="pass" ></td></tr>
- </table>
- <input type="submit" value="Submit">
- </form>
- </center>
- </div>
- <%
- }
- %>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement