每周总结(22/9/10)
作者:互联网
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="login_result.jsp"method="post">
<h1 align="center">用户登录</h1>
<table align="center">
<tr>
<td>用户名称:</td>
<td><input type="text" value="" name="id"/></td>
</tr>
<tr>
<td>用户密码:</td>
<td><input type="password" value="" name="pass"/></td>
</tr>
<tr>
<td><input type="reset" value="重置键"></td>
<td><input type="submit"></td>
</tr>
</table>
</form>
</body>
</html></html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
登录失败,请<a href="index.jsp" >重新登录</a>
</body>
</html>
<%--
Created by IntelliJ IDEA.
User: bin
Date: 2022/9/6
Time: 16:20
To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
//1 获取页面上的登录信息
String id =request.getParameter("id");//获取账号
String pass = request.getParameter("pass");//获取密码
//2 登录验证(跟自己的QQ账号密码比,比死的:下去把自己的账号密码和文件中对比;后期跟数据库中对比,比活的)
if(id.equals("123") && pass.equals("1234")){
//登陆成功
response.sendRedirect("main.html");
}else{
%>
<jsp:forward page = "login2.jsp"></jsp:forward>
<%
}
%>
</body>
</html>
标签:10,UTF,22,登录,每周,title,Insert,pass,id 来源: https://www.cnblogs.com/bin1004/p/16684002.html