⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.jsp

📁 很好用的考试系统很好用的考试系统很好用的考试系统
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="sys.DB"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="java.sql.Connection"%>
<%@page import="java.sql.ResultSet"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
body,html{
top:0px;
margin:0px;
text-align:center;
}
#main
{
width:300px;
}
#main ul li{
list-style-type:none;
}
</style>
</head>
<body>
<%
	request.setCharacterEncoding("UTF-8");
	response.setContentType("text/html;charset=UTF-8");
	if(request.getParameter("action")!=null&&request.getParameter("action").equals("login"))
	{
		DB db = new DB();
		Connection con = db.getConnection();
		String examer_no = request.getParameter("examer_no");
		String card_no = request.getParameter("card_no");
		String type = request.getParameter("type");
		ResultSet rs = db.getResultSet("select * from exam_examinee where examer_no = '"+examer_no+"' and card_no = '"+card_no+"'",con);
		if(rs.next())
		{
			session.setAttribute("examer_no",examer_no);
			if(type!=null&&type.equals("练习"))
				response.sendRedirect("test.jsp");
			else if(type!=null&&type.equals("模拟考试"))
			{
				response.sendRedirect("exam.jsp");
				session.setAttribute("test_type","moni");
			}
			else
				//out.print(type);
				response.sendRedirect("exam.jsp");
		}
	}
%>
<form name="form1" method="post" action="login.jsp?action=login">
<div id="main">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<% 
	//如果系统处于练习状态,显示此选择列表框
	DB db = new DB();
	Connection con = db.getConnection();
	ResultSet rs = db.getResultSet("select * from exam_sys where exam_status = '练习'",con);
	if(rs.next())
		out.print("<tr><td colspan=\"2\"><select name=\"type\"><option>练习</option><option>模拟考试</option></select></td></tr>");
%>
<tr><td width="27%">考生考号:</td><td><input type="text" name="examer_no" id="examer_no"></td></tr>
<tr><td>证号:</td><td><input type="text" name="card_no" id="card_no"></td></tr>
<tr><td colspan="2"><input type="submit" value="登录"></td></tr>
</table>
</div>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -