第六周jsp

<%@ page contentType="text/html;charset=UTF-8" language="java"%>
 2 
 3 <html>
 4 <head>
 5 <title>登陆界面</title>
 6 <link rel="stylesheet" href="./layui/css/layui.css">
 7 <link rel="stylesheet" href="./css/adminLogin.css">
 8 </head>
 9 <body>
10 
11     <div class="wrap">
12         <img src="img/1.jpg" class="imgStyle">
13         <div class="loginForm">
14             <form action="get.jsp" method="POST">
15                 <div class="logoHead"></div>
16                 <div class="usernameWrapDiv">
17                     <div class="usernameLabel">
18                         <label>用户名:</label>
19                     </div>
20                     <div class="usernameDiv">
21                         <i class="layui-icon layui-icon-username adminIcon"></i> <input
22                             id="loginUsername" class="layui-input adminInput" type="text"
23                             name="name" placeholder="输入用户名">
24                     </div>
25                 </div>
26                 <div class="usernameWrapDiv">
27                     <div class="usernameLabel">
28                         <label>密码:</label>
29                     </div>
30                     <div class="passwordDiv">
31                         <i class="layui-icon layui-icon-password adminIcon"></i> <input
32                             id="loginPassword" class="layui-input adminInput" type="password"
33                             name="password" placeholder="输入密码">
34                     </div>
35                 </div>
36                 <div class="usernameWrapDiv">
37                     <div class="usernameLabel">
38                         <label>验证码:</label>
39                     </div>
40                     <div class="cardDiv">
41                         <input id="loginCard" class="layui-input cardInput" type="text"
42                             name="card" placeholder="输入验证码">
43                     </div>
44                     <div id="code_box" class="codeDiv">xxxx</div>
45                 </div>
46                 <div class="usernameWrapDiv">
47                     <div class="submitLabel">
48                         <label>没有账号?<a href="#" id="loginRegister">点击注册</a> </label>
49                     </div>
50                     <div class="submitDiv">
51                         <input id="loginBtn" type="submit"
52                             class="submit layui-btn layui-btn-primary" value="登录"></input>
53                     </div>
54                 </div>
55             </form>
56         </div>
57     </div>
58 
59     <script>
60         var code_box = document.getElementById("code_box");
61 
62         function refreshCode() {
63 
64             var code = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM', char = '', result = '';
65 
66             for ( var i = 0; i < 4; i++) {
67 
68                 var code_index = Math.round(Math.random() * 61);
69 
70                 var char = code[code_index];
71 
72                 if (result.toUpperCase().indexOf(char.toUpperCase()) > -1)
73 
74                 {
75                     i--;
76 
77                     continue;
78                 }
79                 result += char;
80             }
81             code_box.innerHTML = result;
82         }
83 
84         code_box.onclick = refreshCode;
85     </script>
86     <%
87 String name="";
88 if(!session.isNew()){
89 name=(String)session.getAttribute("name");
90 if (name==null){
91 name="";
92 }
93 }
94 %>
95 </body>
96 </html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>register</title>
<style type="text/css" ></style>
</head>
<body>

<form action="login.jsp" method="post">
    用户名:<input type="text" name="uname"><br>&nbsp; 码:<input type="password" name="upwd"><br>
    <input type="submit" value="提交">
</form>
    
</body>
</html>

 

posted @ 2021-04-12 12:23  啪啪怪  阅读(37)  评论(0编辑  收藏  举报