📄 login.jsp
字号:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ include file="JSP/OPENDB.jsp"%>
<%! String username,password,sqlname;%>
<%
//登录
request.setCharacterEncoding("GB2312");
username=request.getParameter("username");
password=request.getParameter("password");
if((username!=null)&(password!=null))
{
//打开数据库查找是否有此用户
sqlname="select * from scott.userinf where username='"+username+"' and password='"+password+"' and forbid='no'";
ResultSet rt=stmt.executeQuery(sqlname);
if (rt.next())
{
if (rt.getString("username")!=""){
session.putValue("oabusyname", rt.getString("name"));
session.putValue("oabusyusername", rt.getString("username"));
session.putValue("oabusyuserdept", rt.getString("userdept"));
session.putValue("oabusyuserlevel", rt.getString("userlevel"));
session.putValue("cook_allow_see_all_workrep", rt.getString("allow_see_all_workrep"));
session.putValue("cook_allow_see_dept_workrep", rt.getString("allow_see_dept_workrep"));
session.putValue("cook_allow_control_dept_user", rt.getString("allow_control_dept_user"));
session.putValue("cook_allow_control_all_user", rt.getString("allow_control_all_user"));
session.putValue("cook_allow_send_note", rt.getString("allow_send_note"));
session.putValue("cook_allow_control_note", rt.getString("allow_control_note"));
session.putValue("cook_allow_control_file", rt.getString("allow_control_file"));
session.putValue("cook_allow_control_level", rt.getString("allow_control_level"));
//如果有此用户就进入系统
response.sendRedirect("system.jsp");
}
}
}
%>
<html>
<head>
<title>人事管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="9pp.css" type="text/css">
</head>
<td width="44%" valign="top">
<div align="center">
<p><br>
<img src="IMAGES/LOGIN.GIF" width="308" height="100"></p>
<table width="350" border="0" cellspacing="0" cellpadding="0" height="233" background="image/b.jpg">
<tr>
<td align="center" height="251">
<form method=post action="login.jsp">
<table border=0 cellpadding="0" cellspacing="0">
<tr>
<td height="35">用户名:
<input type=text name=username size=10>
</td>
</tr>
<tr>
<td height="35">密<font color="#FFFFFF">--</font>码:
<input type=password name=password size=10>
</td>
</tr>
</table>
<br>
<input type=submit name=submit value="登录">
</form></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<center>
<a href="index.jsp">注册</A>
</center>
<%@ include file="foot.jsp"%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -