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

📄 default.jsp

📁 jsp写的一个简单的售药系统(系统需求分析).采用sql2000数据库,通过odbc连接
💻 JSP
字号:
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="Connections/syxt.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 + "&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("TextBox1");
if (MM_valUsername != null) {
  String MM_fldUserAuthorization="";
  String MM_redirectLoginSuccess="index.html";
  String MM_redirectLoginFailed="index.html";
  String MM_redirectLogin=MM_redirectLoginFailed;
  Driver MM_driverUser = (Driver)Class.forName(MM_syxt_DRIVER).newInstance();
  Connection MM_connUser = DriverManager.getConnection(MM_syxt_STRING,MM_syxt_USERNAME,MM_syxt_PASSWORD);
  String MM_pSQL = "SELECT yhm,yhh, mm";
  if (!MM_fldUserAuthorization.equals("")) MM_pSQL += "," + MM_fldUserAuthorization;
  MM_pSQL += " FROM dbo.dl WHERE yhh=? AND mm=?";
  PreparedStatement MM_statementUser = MM_connUser.prepareStatement(MM_pSQL);
  MM_statementUser.setObject(1, MM_valUsername);
  MM_statementUser.setObject(2, request.getParameter("TextBox2"));
  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_rsUser.getString("yhm"));
    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>
</head>

<body background="1.jpg">
        <form id="form1" name="form1" method="POST" action="<%=MM_LoginAction%>">
          <div class="login_main"> <span class="login_logo"> <img src="2.jpg" width="406" height="42" /></span> <span class="login_input">
            <ul>
              <li>
                <label>用户名:</label>
                <input name="TextBox1" type="text" class="text_nor" id="TextBox1" style="width:120px;" tabindex="1" value="5384" />
              </li>
              <li>
                <label>密 &nbsp; 码:</label>
                <input name="TextBox2" type="password" class="text_nor" id="TextBox2" style="width:120px;" tabindex="2" value="5384" />
              </li>
             
                <br />

                <p>
                  <input type="submit" name="aa01" id="aa01" value="登陆" />
                  <br />
                  
                    </p>
            </ul>
          </span></div>
</form>
</body>
</html>

⌨️ 快捷键说明

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