?? chklogin.jsp
字號:
<%@ page contentType="text/html; charset=gbk" language="java" import="java.sql.*" errorPage="" %>
<%@page import="manage.*"%>
<html>
<head>
<!-- TemplateBeginEditable name="doctitle" -->
<title>安全監察系統</title>
<!-- TemplateEndEditable -->
<link rel="stylesheet" rev="stylesheet" href="../css/main.css" type="text/css" media="all" />
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
</head>
<jsp:useBean id="jdbcbean" class="manage.JdbcBean" />
<body bgcolor="#FFFFFF">
<table width="770" height="423" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td height="421" bgcolor="#FFFFFF"><table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="359" height="69"><img src="../images/logo.GIF" width="322" height="69"></td>
<td width="411" align="right" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td colspan="2"><img src="../images/TOPBAR.GIF" width="770" height="69"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
<table width="770" height="290" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="167" height="290" align="center" valign="middle" bgcolor="#FF9900">
<div align="center">歡迎來到安全監察系統 <br>
<p> </p>
<br>
<p> </p>
<p> </p>
<p> </p>
<br>
</div></td>
<td width="603" align="center" valign="top">
<table width="100%" height="85%" border="0" cellpadding="3" cellspacing="1" bgcolor="#666666">
<tr>
<td width="488" height="348" align="left" valign="top" bgcolor="#FFCC33"><br>
<%
String username=new String(request.getParameter("username").getBytes("ISO8859_1"),"GBK");
String password=new String(request.getParameter("password").getBytes("ISO8859_1"),"GBK");
int role=0;
ResultSet rs=jdbcbean.executeQuery("select * from user where userid='"+username+"' and password='"+password+"'");
if(rs.next())
{String check="T";
session.setAttribute("login",check);
role=rs.getInt("role");
if(role==1)
response.sendRedirect("admin.jsp");
else
response.sendRedirect("user.jsp");
}
else {
%>
<h3> </h3>
<h3> <font size="+1"><strong> </strong> <font size="3">用戶名或密碼有誤,請重新登錄!</font></font></h3>
<%
}
rs.close();
jdbcbean.closeDB();
%>
<a href="javascript:history.back();">返回</a> </td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -