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

📄 login_account.jsp

📁 好东西好东西好东西好东西好东西好东西好东西
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%request.setCharacterEncoding("gb2312");%>
<%@ include file="Connections/myesale.jsp" %>
<% 
  String errMsg=request.getParameter("Msg");
  if(errMsg!=null) errMsg="帐号或密码输入错误,请重新输入!!!";
  else  errMsg=""; %>
<%
// *** 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 + "&lt;";
    else if (queryString.charAt(i) == '>') tempStr = tempStr + "&gt;";
    else if (queryString.charAt(i) == '"') tempStr = tempStr +  "&quot;";
    else tempStr = tempStr + queryString.charAt(i);
  }
  MM_LoginAction += "?" + tempStr;
}
String MM_valUsername=request.getParameter("username");
if (MM_valUsername != null) {
  String MM_fldUserAuthorization="";
  String MM_redirectLoginSuccess="account.jsp";
  String MM_redirectLoginFailed="login_account.jsp?Msg=1";
  String MM_redirectLogin=MM_redirectLoginFailed;
  Driver MM_driverUser = (Driver)Class.forName(MM_myesale_DRIVER).newInstance();
  Connection MM_connUser = DriverManager.getConnection(MM_myesale_STRING,MM_myesale_USERNAME,MM_myesale_PASSWORD);
  String MM_pSQL = "SELECT username, password";
  if (!MM_fldUserAuthorization.equals("")) MM_pSQL += "," + MM_fldUserAuthorization;
  MM_pSQL += " FROM customers WHERE username=\'" + MM_valUsername.replace('\'', ' ') + "\' AND 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;
}
%>
<html>
<head>
<title>账户管理-会员登入</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.style5 {
	color: #FFFFFF;
	font-size: 18;
}
.style8 {font-size: 24px}
.style12 {color: #000000; font-size: 18; }
.style13 {
	color: #FFFFFF;
	font-weight: bold;
}
.style6 {color: #009933}
.BOX {
	border: 6px solid #339999;
	margin-top: 10px;
	margin-right: 0px;
	margin-bottom: 10px;
	margin-left: 0px;
}
.style14 {color: #FFFF00}
.style19 {
	color: #FF0000;
	font-weight: bold;
	font-size: 16px;
}
-->
</style>
</head>

<body>
<div align="center">
  <table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="7"><table width="200" border="3" align="center" cellpadding="2" cellspacing="1" bordercolor="#FFDEC1" class="style6">
        <tr>
          <td><img src="images/esale_title.jpg" width="760" height="120"></td>
        </tr>
      </table></td>
    </tr>
    <tr background="images/life_23.gif">
      <td height="20" colspan="7" background="images/line_top.gif">&nbsp;</td>
    </tr>
    <tr>
      <td width="20" rowspan="3" background="images/line_top.gif">&nbsp;</td>
      <td width="16" rowspan="3" valign="top">&nbsp;</td>
      <td width="50" height="50" align="left" valign="top"><img src="images/border_ul.gif" width="50" height="51"></td>
      <td width="586" rowspan="3" align="center"><table width="100%" border="0" align="center" cellpadding="4" cellspacing="0" class="BOX">
        <tr bgcolor="#339999">
          <td colspan="2"><div align="center" class="style8 style14"><strong> 会员登入</strong></div></td>
        </tr>
        <tr>
          <td width="418" height="163" valign="middle"><form action="<%=MM_LoginAction%>" name="form1" method="POST">
              <div align="center">
                <p align="left">
                  <% if(session.getAttribute("MM_Username")!=null){
      response.sendRedirect("account.jsp");
	} %>
                </p>
                <table width="80%" border="2" bordercolor="#CCCC66">
                  <tr>
                    <td width="151" bgcolor="#CCFFCC"><div align="right" class="style8">使用者名称</div></td>
                    <td width="169"><input name="username" type="text" id="username" size="20" maxlength="10" /></td>
                  </tr>
                  <tr>
                    <td bgcolor="#CCFFCC"><div align="right" class="style8">密码</div></td>
                    <td><input name="password" type="password" id="password" size="20" maxlength="10" /></td>
                  </tr>
                </table>
                <br />
                <input type="submit" name="Submit" value="登入" />
              </div>
          </form></td>
          <td width="30%" rowspan="2" valign="top"><table width="100%" border="1" align="center" cellpadding="2" cellspacing="2" bordercolor="#3399FF">
              <tr>
                <td bgcolor="#FF9900"><div align="center" class="style8 style13"> 帐户管理 </div></td>
              </tr>
              <tr>
                <td><div align="justify" class="style5"></div></td>
              </tr>
              <tr>
                <td bgcolor="#E8E8E8"><div align="center" class="style12">
                    <div align="left">1.检查账户资料</div>
                </div></td>
              </tr>
              <tr>
                <td><div align="justify" class="style12"></div></td>
              </tr>
              <tr>
                <td bgcolor="#E8E8E8"><div align="center" class="style12">
                    <div align="left">2.订单查询</div>
                </div></td>
              </tr>
              <tr>
                <td><div align="center" class="style12">
                    <div align="justify"></div>
                </div></td>
              </tr>
              <tr>
                <td bgcolor="#E8E8E8" class="style12">3.购物记录</td>
              </tr>
          </table></td>
        </tr>
        <tr>
          <td align="right" valign="middle"><div align="center" class="style19"><%= errMsg %></div></td>
        </tr>
        <tr bgcolor="#339999">
          <td colspan="2">&nbsp;</td>
        </tr>
      </table></td>
      <td width="50" height="50" align="right" valign="top"><img src="images/border_ur.gif" width="50" height="51"></td>
      <td width="16" rowspan="3">&nbsp;</td>
      <td width="20" rowspan="3" background="images/line_top.gif">&nbsp;</td>
    </tr>
    <tr>
      <td width="50" height="166">&nbsp;</td>
      <td width="50" height="166">&nbsp;</td>
    </tr>
    <tr>
      <td width="50" height="50" align="left" valign="bottom"><img src="images/border_dl.gif" width="50" height="51"></td>
      <td width="50" height="50" align="right" valign="bottom" background="ima"><img src="images/border_dr.gif" width="50" height="51"></td>
    </tr>
    <tr>
      <td height="20" colspan="7" background="images/line_top.gif">&nbsp;</td>
    </tr>
  </table>
  <p>&nbsp;</p>
</div>
</body>
</html>

⌨️ 快捷键说明

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