.
This commit is contained in:
69
WebRoot/JSPhandle/admin_insert.jsp
Normal file
69
WebRoot/JSPhandle/admin_insert.jsp
Normal file
@@ -0,0 +1,69 @@
|
||||
<%@ page language="java" import="java.sql.*"
|
||||
contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
||||
+ path + "/";
|
||||
%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
|
||||
<title>检验插入页面</title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<br>
|
||||
<%
|
||||
boolean flag = false;
|
||||
request.setCharacterEncoding("utf-8");
|
||||
String adminNo = request.getParameter("adminno");
|
||||
String name = request.getParameter("adminname");
|
||||
String adminsex = request.getParameter("sex");
|
||||
String adminjob = request.getParameter("job");
|
||||
%>
|
||||
<%
|
||||
String driver = "com.mysql.jdbc.Driver";
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
Connection conn = DriverManager.getConnection(url, use, password);
|
||||
PreparedStatement sql = conn
|
||||
.prepareStatement("insert into adminstrator_record(AdminNo,AdminName,Adminsex,Adminjob)values(?,?,?,?)");
|
||||
sql.setString(1, adminNo);
|
||||
sql.setString(2, name);
|
||||
sql.setString(3, adminsex);
|
||||
sql.setString(4, adminjob);
|
||||
int rtn = sql.executeUpdate();
|
||||
if (rtn != 0) {
|
||||
flag = true;
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
if (flag == true) {
|
||||
%>
|
||||
<jsp:forward page="insert_success.jsp" />
|
||||
<%
|
||||
} else if (flag == false) {
|
||||
%>
|
||||
<jsp:forward page="insert_success.jsp" />
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</body>
|
||||
</html>
|
||||
65
WebRoot/JSPhandle/adminjob_insert.jsp
Normal file
65
WebRoot/JSPhandle/adminjob_insert.jsp
Normal file
@@ -0,0 +1,65 @@
|
||||
<%@ page language="java" import="java.sql.*"
|
||||
contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
||||
+ path + "/";
|
||||
%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
|
||||
<title>检验插入页面</title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<br>
|
||||
<%
|
||||
boolean flag = false;
|
||||
request.setCharacterEncoding("utf-8");
|
||||
String name = request.getParameter("jobname");
|
||||
String duty = request.getParameter("jobduty");
|
||||
%>
|
||||
<%
|
||||
String driver = "com.mysql.jdbc.Driver";
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
Connection conn = DriverManager.getConnection(url, use, password);
|
||||
PreparedStatement sql = conn
|
||||
.prepareStatement("insert into administrator_job(AdminJob,AdminDuty)values(?,?)");
|
||||
sql.setString(1, name);
|
||||
sql.setString(2, duty);
|
||||
int rtn = sql.executeUpdate();
|
||||
if (rtn != 0) {
|
||||
flag = true;
|
||||
}
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
<!-- 判断是否是插入成功 -->
|
||||
<%
|
||||
if (flag == true) {
|
||||
%>
|
||||
<jsp:forward page="insert_success.jsp" />
|
||||
<%
|
||||
} else if (flag == false) {
|
||||
%>
|
||||
<jsp:forward page="insert_success.jsp" />
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</body>
|
||||
</html>
|
||||
49
WebRoot/JSPhandle/change_pass_update.jsp
Normal file
49
WebRoot/JSPhandle/change_pass_update.jsp
Normal file
@@ -0,0 +1,49 @@
|
||||
<%@ page language="java" import="java.sql.*" contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
|
||||
<title>检验注册页面</title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<br>
|
||||
<%
|
||||
request.setCharacterEncoding("utf-8");
|
||||
String users=(String)session.getAttribute("actualuser");
|
||||
String pass=request.getParameter("inputPassword");
|
||||
%>
|
||||
<%
|
||||
String driver = "com.mysql.jdbc.Driver";
|
||||
String url="jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
Connection conn= DriverManager.getConnection(url,use,password);
|
||||
PreparedStatement sql =conn.prepareStatement("update user set password=? where userName=?");
|
||||
sql.setString(1,pass);
|
||||
sql.setString(2,users);
|
||||
int rtn=sql.executeUpdate();
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
<%
|
||||
out.println("<script language=javascript>alert('修改成功!');window.location.href='index.html'</script>");
|
||||
%>
|
||||
</body>
|
||||
</html>
|
||||
66
WebRoot/JSPhandle/forget_pass_check.jsp
Normal file
66
WebRoot/JSPhandle/forget_pass_check.jsp
Normal file
@@ -0,0 +1,66 @@
|
||||
<%@ page language="java" import="java.sql.*"
|
||||
contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
||||
+ path + "/";
|
||||
%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
<title>My JSP 'check.jsp' starting page</title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
request.setCharacterEncoding("utf-8");
|
||||
String users = request.getParameter("inputUser");
|
||||
String pass = request.getParameter("inputPassword");
|
||||
String phone = request.getParameter("PhoneNumber");
|
||||
boolean flag = false;
|
||||
PreparedStatement sql = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
|
||||
%>
|
||||
|
||||
<%
|
||||
String driver = "com.mysql.jdbc.Driver";
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
conn = DriverManager.getConnection(url, use, password);
|
||||
sql = conn.prepareStatement("select * from user where userName=? and Email=? and phoneNum=?");
|
||||
sql.setString(1, users);
|
||||
sql.setString(2, pass);
|
||||
sql.setString(3, phone);
|
||||
rs = sql.executeQuery();
|
||||
if (rs.next()) {
|
||||
flag = true;
|
||||
}
|
||||
%>
|
||||
<!-- 判断是否是正确的登录用户 -->
|
||||
<%
|
||||
if (flag == true) {
|
||||
session.setAttribute("actualuser", users);
|
||||
%>
|
||||
<jsp:forward page="login_show.jsp" />
|
||||
<%
|
||||
} else if (flag == false) {
|
||||
out.println("<script language=javascript>alert('邮箱或手机输入有误,修改失败');window.location.href='index.html'</script>");
|
||||
}
|
||||
rs.close();
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
</body>
|
||||
</html>
|
||||
29
WebRoot/JSPhandle/insert_fail.jsp
Normal file
29
WebRoot/JSPhandle/insert_fail.jsp
Normal file
@@ -0,0 +1,29 @@
|
||||
<%@ page language="java" import="java.sql.*" contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
|
||||
<title>插入失败</title>
|
||||
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<% out.println("插入失败,5秒后自动跳转回主页面");%>
|
||||
<% response.setHeader("refresh","5;url=../mainframe.jsp");%>
|
||||
</body>
|
||||
</html>
|
||||
27
WebRoot/JSPhandle/insert_success.jsp
Normal file
27
WebRoot/JSPhandle/insert_success.jsp
Normal file
@@ -0,0 +1,27 @@
|
||||
<%@ page language="java" import="java.util.*" contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
<title>插入成功</title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
插入成功. <br>
|
||||
<% response.setHeader("refresh","1;url=mainframe.jsp");%>
|
||||
</body>
|
||||
</html>
|
||||
68
WebRoot/JSPhandle/limits_check_manage.jsp
Normal file
68
WebRoot/JSPhandle/limits_check_manage.jsp
Normal file
@@ -0,0 +1,68 @@
|
||||
<%@ page language="java" import="java.sql.*"
|
||||
contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
||||
+ path + "/";
|
||||
%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
<title>My JSP 'check.jsp' starting page</title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
request.setCharacterEncoding("utf-8");
|
||||
boolean flag = false;
|
||||
PreparedStatement sql = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
if (session.getAttribute("actualuser") == null) {
|
||||
out.println(
|
||||
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
||||
return;
|
||||
}
|
||||
Object user0 = session.getAttribute("actualuser");
|
||||
String users = (String) user0;
|
||||
%>
|
||||
|
||||
<%
|
||||
String driver = "com.mysql.jdbc.Driver";
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
conn = DriverManager.getConnection(url, use, password);
|
||||
sql = conn.prepareStatement("select * from show_user where userName=? and Administrator=1");
|
||||
sql.setString(1, users);
|
||||
rs = sql.executeQuery();
|
||||
if (rs.next()) {
|
||||
flag = true;
|
||||
}
|
||||
rs.close();
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
<!-- 判断是否是管理员 -->
|
||||
<%
|
||||
if (flag == true) {
|
||||
%>
|
||||
<jsp:forward page="../manage_user.jsp" />
|
||||
<%
|
||||
} else if (flag == false) {
|
||||
out.println(
|
||||
"<script language=javascript>alert('你不是管理员,不能访问此版块');window.location.href='../mainframe.jsp'</script>");
|
||||
return;
|
||||
}
|
||||
%>
|
||||
</body>
|
||||
</html>
|
||||
67
WebRoot/JSPhandle/limits_check_show.jsp
Normal file
67
WebRoot/JSPhandle/limits_check_show.jsp
Normal file
@@ -0,0 +1,67 @@
|
||||
<%@ page language="java" import="java.sql.*"
|
||||
contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
||||
+ path + "/";
|
||||
%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
<title></title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
request.setCharacterEncoding("utf-8");
|
||||
boolean flag = false;
|
||||
PreparedStatement sql = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
if (session.getAttribute("actualuser") == null) {
|
||||
out.println(
|
||||
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
||||
return;
|
||||
}
|
||||
Object user0 = session.getAttribute("actualuser");
|
||||
String users = (String) user0;
|
||||
%>
|
||||
|
||||
<%
|
||||
String driver = "com.mysql.jdbc.Driver";
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
conn = DriverManager.getConnection(url, use, password);
|
||||
sql = conn.prepareStatement("select * from show_user where userName=? and Administrator=1");
|
||||
sql.setString(1, users);
|
||||
rs = sql.executeQuery();
|
||||
if (rs.next()) {
|
||||
flag = true;
|
||||
}
|
||||
rs.close();
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
<!-- 判断是否是管理员 -->
|
||||
<%
|
||||
if (flag == true) {
|
||||
response.setHeader("refresh","0;url=../show_user.jsp");
|
||||
} else if (flag == false) {
|
||||
out.println("<script language=javascript>alert('你不是管理员,不能访问此版块')</script>");
|
||||
response.setHeader("refresh","1;url=../mainframe.jsp");
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
86
WebRoot/JSPhandle/login.jsp
Normal file
86
WebRoot/JSPhandle/login.jsp
Normal file
@@ -0,0 +1,86 @@
|
||||
<%@ page language="java" import="java.sql.*"
|
||||
contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
||||
+ path + "/";
|
||||
%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
<title>My JSP 'check.jsp' starting page</title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
request.setCharacterEncoding("utf-8");
|
||||
String users = request.getParameter("inputUser");
|
||||
String pass = request.getParameter("inputPassword");
|
||||
boolean flag = false;
|
||||
PreparedStatement sql = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement vipsql = null;
|
||||
ResultSet viprs = null;
|
||||
session.setAttribute("actualuser", users);
|
||||
session.setMaxInactiveInterval(1440);
|
||||
%>
|
||||
|
||||
<%
|
||||
String driver = "com.mysql.jdbc.Driver";
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
conn = DriverManager.getConnection(url, use, password);
|
||||
sql = conn.prepareStatement("select * from user where userName=? and password=?");
|
||||
sql.setString(1, users);
|
||||
sql.setString(2, pass);
|
||||
rs = sql.executeQuery();
|
||||
if (rs.next()) {
|
||||
flag = true;
|
||||
}
|
||||
%>
|
||||
<%
|
||||
try {
|
||||
vipsql = conn.prepareStatement(
|
||||
"select userName,case when VIP = 1 then 'VIP用户' else '普通用户' end as VIP,case when Administrator = 1 then '管理员' else '' end as Administrator from show_user where userName=?");
|
||||
vipsql.setString(1, users);
|
||||
viprs = vipsql.executeQuery();
|
||||
while (viprs.next()) {
|
||||
String vipinfo = viprs.getString("VIP");
|
||||
String adminfo = viprs.getString("Administrator");
|
||||
session.setAttribute("VIPuser", vipinfo);
|
||||
session.setAttribute("Adminuser", adminfo);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<!-- 判断是否是正确的登录用户 -->
|
||||
<%
|
||||
if (flag == true) {
|
||||
%>
|
||||
<jsp:forward page="login_show.jsp" />
|
||||
<%
|
||||
} else if (flag == false) {
|
||||
%>
|
||||
<jsp:forward page="login_fail.jsp" />
|
||||
<%
|
||||
}
|
||||
viprs.close();
|
||||
vipsql.close();
|
||||
rs.close();
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
</body>
|
||||
</html>
|
||||
29
WebRoot/JSPhandle/login_fail.jsp
Normal file
29
WebRoot/JSPhandle/login_fail.jsp
Normal file
@@ -0,0 +1,29 @@
|
||||
<%@ page language="java" import="java.sql.*" contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
|
||||
<title>登录失败</title>
|
||||
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<% out.println("登录失败,5秒后自动跳转回登录页面");%>
|
||||
<% response.setHeader("refresh","5;url=../index.html");%>
|
||||
</body>
|
||||
</html>
|
||||
27
WebRoot/JSPhandle/login_show.jsp
Normal file
27
WebRoot/JSPhandle/login_show.jsp
Normal file
@@ -0,0 +1,27 @@
|
||||
<%@ page language="java" import="java.util.*" contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
<title>登录成功</title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
登录成功. <br>
|
||||
<% response.setHeader("refresh","0;url=../mainframe.jsp");%>
|
||||
</body>
|
||||
</html>
|
||||
10
WebRoot/JSPhandle/logout.jsp
Normal file
10
WebRoot/JSPhandle/logout.jsp
Normal file
@@ -0,0 +1,10 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
<%
|
||||
session.removeAttribute("actualuser");
|
||||
out.println("<script>window.location.href='../index.html'</script>");
|
||||
|
||||
%>
|
||||
17
WebRoot/JSPhandle/session.jsp
Normal file
17
WebRoot/JSPhandle/session.jsp
Normal file
@@ -0,0 +1,17 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8"
|
||||
pageEncoding="utf-8"%>
|
||||
<%@ page import="login.*" %>
|
||||
<%
|
||||
login in = new login();
|
||||
String actualname = request.getParameter("inputUser");
|
||||
boolean isLoginSucc = in.Login(actualname);
|
||||
if(isLoginSucc)
|
||||
{
|
||||
session.setAttribute("inputUser", actualname);
|
||||
session.setMaxInactiveInterval(1440);
|
||||
}
|
||||
else
|
||||
{
|
||||
out.println("<script>alert('登陆失败!');window.location.href='../index.html'</script>");
|
||||
}
|
||||
%>
|
||||
51
WebRoot/JSPhandle/signin_insert.jsp
Normal file
51
WebRoot/JSPhandle/signin_insert.jsp
Normal file
@@ -0,0 +1,51 @@
|
||||
<%@ page language="java" import="java.sql.*" contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
||||
%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
|
||||
<title>检验注册页面</title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<br>
|
||||
<%
|
||||
request.setCharacterEncoding("utf-8");
|
||||
String users=request.getParameter("inputUser");
|
||||
String pass=request.getParameter("Password2");
|
||||
String email=request.getParameter("Email");
|
||||
String PhoneNumber=request.getParameter("PhoneNumber");
|
||||
%>
|
||||
<%
|
||||
String driver = "com.mysql.jdbc.Driver";
|
||||
String url="jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
Connection conn= DriverManager.getConnection(url,use,password);
|
||||
PreparedStatement sql =conn.prepareStatement("insert into user(userName,password,Email,phoneNum)values(?,?,?,?)");
|
||||
sql.setString(1,users);
|
||||
sql.setString(2,pass);
|
||||
sql.setString(3,email);
|
||||
sql.setString(4,PhoneNumber);
|
||||
int rtn=sql.executeUpdate();
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
<% response.setHeader("refresh","0;url=signin_show.jsp");%>
|
||||
</body>
|
||||
</html>
|
||||
67
WebRoot/JSPhandle/vipdownload_check_show.jsp
Normal file
67
WebRoot/JSPhandle/vipdownload_check_show.jsp
Normal file
@@ -0,0 +1,67 @@
|
||||
<%@ page language="java" import="java.sql.*"
|
||||
contentType="text/html;charset=utf-8"%>
|
||||
<%
|
||||
String path = request.getContextPath();
|
||||
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
||||
+ path + "/";
|
||||
%>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<base href="<%=basePath%>">
|
||||
<title></title>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
||||
<meta http-equiv="description" content="This is my page">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
-->
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
request.setCharacterEncoding("utf-8");
|
||||
boolean flag = false;
|
||||
PreparedStatement sql = null;
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
if (session.getAttribute("actualuser") == null) {
|
||||
out.println(
|
||||
"<script language=javascript>alert('登录超时 (1440 秒未活动)或未登录,请重新登录。');window.location.href='index.html'</script>");
|
||||
return;
|
||||
}
|
||||
Object user0 = session.getAttribute("actualuser");
|
||||
String users = (String) user0;
|
||||
%>
|
||||
|
||||
<%
|
||||
String driver = "com.mysql.jdbc.Driver";
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String use = "root";
|
||||
String password = "";
|
||||
Class.forName(driver);
|
||||
conn = DriverManager.getConnection(url, use, password);
|
||||
sql = conn.prepareStatement("select * from show_user where userName=? and VIP=1");
|
||||
sql.setString(1, users);
|
||||
rs = sql.executeQuery();
|
||||
if (rs.next()) {
|
||||
flag = true;
|
||||
}
|
||||
rs.close();
|
||||
sql.close();
|
||||
conn.close();
|
||||
%>
|
||||
<!-- 判断是否是管理员 -->
|
||||
<%
|
||||
if (flag == true) {
|
||||
response.setHeader("refresh","0;url=../x2_resource.jsp");
|
||||
} else if (flag == false) {
|
||||
out.println("<script language=javascript>alert('你不是VIP,不能访问此版块')</script>");
|
||||
response.setHeader("refresh","1;url=../mainframe.jsp");
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1
WebRoot/JSPhandle/目录.txt
Normal file
1
WebRoot/JSPhandle/目录.txt
Normal file
@@ -0,0 +1 @@
|
||||
../JSPhandle/
|
||||
Reference in New Issue
Block a user