📄 index.jsp
字号:
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="Connections/conn.jsp" %>
<%
// *** Validate request to log in to this site.
String MM_LoginAction = request.getRequestURI();
if (request.getQueryString() != null && request.getQueryString().length() > 0) {
String queryString = request.getQueryString();
String tempStr = "";
for (int i=0; i < queryString.length(); i++) {
if (queryString.charAt(i) == '<') tempStr = tempStr + "<";
else if (queryString.charAt(i) == '>') tempStr = tempStr + ">";
else if (queryString.charAt(i) == '"') tempStr = tempStr + """;
else tempStr = tempStr + queryString.charAt(i);
}
MM_LoginAction += "?" + tempStr;
}
String MM_valUsername=request.getParameter("logname");
if (MM_valUsername != null) {
String MM_fldUserAuthorization="";
String MM_redirectLoginSuccess="userFrameset.jsp";
String MM_redirectLoginFailed="u_failin.jsp";
String MM_redirectLogin=MM_redirectLoginFailed;
Driver MM_driverUser = (Driver)Class.forName(MM_conn_DRIVER).newInstance();
Connection MM_connUser = DriverManager.getConnection(MM_conn_STRING,MM_conn_USERNAME,MM_conn_PASSWORD);
String MM_pSQL = "SELECT m_logname, m_password";
if (!MM_fldUserAuthorization.equals("")) MM_pSQL += "," + MM_fldUserAuthorization;
MM_pSQL += " FROM dbo.member WHERE m_logname=\'" + MM_valUsername.replace('\'', ' ') + "\' AND m_password=\'" + request.getParameter("password").toString().replace('\'', ' ') + "\'";
PreparedStatement MM_statementUser = MM_connUser.prepareStatement(MM_pSQL);
ResultSet MM_rsUser = MM_statementUser.executeQuery();
boolean MM_rsUser_isNotEmpty = MM_rsUser.next();
if (MM_rsUser_isNotEmpty) {
// username and password match - this is a valid user
session.putValue("MM_Username", MM_valUsername);
if (!MM_fldUserAuthorization.equals("")) {
session.putValue("MM_UserAuthorization", MM_rsUser.getString(MM_fldUserAuthorization).trim());
} else {
session.putValue("MM_UserAuthorization", "");
}
if ((request.getParameter("accessdenied") != null) && false) {
MM_redirectLoginSuccess = request.getParameter("accessdenied");
}
MM_redirectLogin=MM_redirectLoginSuccess;
}
MM_rsUser.close();
MM_connUser.close();
response.sendRedirect(response.encodeRedirectURL(MM_redirectLogin));
return;
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>酒店收银管理系统</title>
<STYLE>
#Layer1 {
Z-INDEX: 1;
WIDTH: 118px;
POSITION: absolute;
HEIGHT: 28px
}
body {
}
</STYLE>
</head>
<body>
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<th colspan="2" bgcolor="#ba5730" scope="col"> </th>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td valign="top"><table width="213" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="FONT-SIZE: 14px; COLOR: #323229" align="left" background="img/res-bg.jpg" height="49"><strong> 酒店会员/管理员登录</strong></td>
</tr>
<tr>
<td><form ACTION="<%=MM_LoginAction%>" id="form1" name="form1" method="POST">
<table width="213" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="FONT-SIZE: 13px; COLOR: #323229"align="left" width="29%" height="28"> 用户名:</td>
<td width="71%"><input style="WIDTH: 100px" name="logname" /></td>
</tr>
<tr>
<td style="FONT-SIZE: 13px; COLOR: #323229"align="left" width="29%" height="28"> 密 码:</td>
<td><input style="WIDTH: 100px" type="password" name="password" /></td>
</tr>
<tr>
<td align="center"><label>
<input type="submit" name="submit" id="submit" value="提交" />
</label>
</td>
<td align="center"><lable>
<input type="reset" name="reset" id="reset" value="重置" />
</lable>
</td>
</tr>
<tr>
<td style="FONT-SIZE: 13px; COLOR: #323229" colspan="2" height="70">。 </td>
</tr>
<tr>
<td height="18" colspan="2" align="right" ><a style="FONT-SIZE: 13px; COLOR: #323229" href="u_register.jsp">>>会员注册 </a></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td valign="top"><table width="459" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="PADDING-RIGHT: 80px; FONT-SIZE: 16px; COLOR: #ffffff" align=right background="img/res-bg2.jpg" height=49><strong><a href="adminLogin.jsp" style="PADDING-RIGHT: 80px; FONT-SIZE: 16px; COLOR: #ffffff">管理员登录</a></strong></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height=22 colSpan=2 background="img/newsbutton-bg.jpg" style="FONT-SIZE: 13px; COLOR: #323229"> </td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td style="FONT-SIZE: 13px; COLOR: #323229" colspan="2" align="center" bgcolor="#ba5730"> </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -