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

📄 admin_login.asp

📁 asp+sql的教室申请系统,可以完成一个学期的教室分配情况
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/CSYD.asp" -->
<%
Dim rs
Dim rs_numRows

Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_CSYD_STRING
rs.Source = "SELECT * FROM CS_login ORDER BY ID ASC"
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()

rs_numRows = 0
%>
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("username"))
If MM_valUsername <> "" Then
  MM_fldUserAuthorization="gljiaoshi"
  MM_redirectLoginSuccess="admin.asp"
  MM_redirectLoginFailed="Admin_login.asp"
  MM_flag="ADODB.Recordset"
  set MM_rsUser = Server.CreateObject(MM_flag)
  MM_rsUser.ActiveConnection = MM_CSYD_STRING
  MM_rsUser.Source = "SELECT username, passwd"
  If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
  MM_rsUser.Source = MM_rsUser.Source & " FROM CS_login WHERE username='" & Replace(MM_valUsername,"'","''") &"' AND passwd='" & Replace(Request.Form("passwd"),"'","''") & "'"
  MM_rsUser.CursorType = 0
  MM_rsUser.CursorLocation = 2
  MM_rsUser.LockType = 3
  MM_rsUser.Open
  If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then 
    ' username and password match - this is a valid user
    Session("MM_Username") = MM_valUsername
    If (MM_fldUserAuthorization <> "") Then
      Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
    Else
      Session("MM_UserAuthorization") = ""
    End If
    if CStr(Request.QueryString("accessdenied")) <> "" And false Then
      MM_redirectLoginSuccess = Request.QueryString("accessdenied")
    End If
    MM_rsUser.Close
    Response.Redirect(MM_redirectLoginSuccess)
  End If
  MM_rsUser.Close
  Response.Redirect(MM_redirectLoginFailed)
End If
%>
<html>
<head>
<title>管理员登陆</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-color: #797979;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>
<body>
<!-- ImageReady Slices (002.psd) -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><div align="center">
      <table id="__01" width="770" height="426" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td> <img src="images/003_01.gif" width="770" height="42" alt=""></td>
        </tr>
        <tr>
          <td> <img src="images/003_02.gif" width="770" height="168" alt=""></td>
        </tr>
        <tr>
          <td width="770" height="216" background="images/003_03.gif"><table width="100%" height="77"  border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="64%">&nbsp;</td>
                <td width="36%"><form name="form1" method="POST" action="<%=MM_LoginAction%>">
                    <table width="166" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
                      <tr>
                        <td><table width="185" height="108"  border="0" cellpadding="0" cellspacing="1">
                            <tr>
                              <td width="171" height="22" bgcolor="#CCCCCC"><div align="center">用户登录</div></td>
                            </tr>
                            <tr>
                              <td height="23" bgcolor="efefef">&nbsp;&nbsp;用户名:
                                <input name="username" type="text" class="inputs" id="username" size="12"></td>
                            </tr>
                            <tr>
                              <td height="24" bgcolor="efefef">&nbsp;&nbsp;密&nbsp;&nbsp;码:
                                <input name="passwd" type="password" class="inputs" id="passwd" size="12"></td>
                            </tr>
                            <tr>
                              <td height="29" bgcolor="efefef"><div align="center">
                                  <input name="Submit" type="submit" class="button" value="确定">
                                  <input name="Submit2" type="reset" class="button" value="重置">
                              </div></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table>
                </form></td>
              </tr>
          </table></td>
        </tr>
      </table>
    </div></td>
  </tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>
<%
rs.Close()
Set rs = Nothing
%>

⌨️ 快捷键说明

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