📄 admin_login.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Connections/conn.asp" -->
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
If (CStr(Request("MM_insert")) = "form1") Then
MM_editConnection = MM_conn_STRING
MM_editTable = "caozuojilu"
MM_editRedirectUrl = ""
MM_fieldsStr = "jilu|value|username|value|IP|value"
MM_columnsStr = "jilu|',none,''|username|',none,''|IP|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
Dim MM_tableValues
Dim MM_dbValues
If (CStr(Request("MM_insert")) <> "") Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_formVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
Recordset1.Source = "SELECT * FROM gjadmin"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_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("user"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization="jibie"
MM_redirectLoginSuccess="index.asp"
MM_redirectLoginFailed="../zx/shibai1.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_conn_STRING
MM_rsUser.Source = "SELECT admin, power"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM gjadmin WHERE admin='" & Replace(MM_valUsername,"'","''") &"' AND power='" & Replace(Request.Form("power"),"'","''") & "'"
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
%>
<%
'******************************
'函数:Userip()
'参数:无
'作者:阿里西西
'日期:2007/7/12
'描述:取得客户端IP地址
'示例:<%=Userip()
'******************************
Function Userip()
Dim GetClientIP
'如果客户端用了代理服务器,则应该用ServerVariables("HTTP_X_FORWARDED_FOR")方法
GetClientIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If GetClientIP = "" or isnull(GetClientIP) or isempty(GetClientIP) Then
'如果客户端没用代理,应该用Request.ServerVariables("REMOTE_ADDR")方法
GetClientIP = Request.ServerVariables("REMOTE_ADDR")
end if
Userip = GetClientIP
End function
%>
<head>
<title>培英学校学籍管理转学生子系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">
<!--
body {
background-color: #CCCCCC;
}
.STYLE1 {font-size: 12px}
.STYLE3 {
font-size: 30px;
color: #FFFF00;
font-family: "宋体";
font-weight: bold;
font-style: italic;
}
.STYLE9 {color: #FF0000}
-->
</style></head>
<body>
<form ACTION="<%=MM_LoginAction%>" name="form1" method="POST">
<p align="center" class="STYLE3"> </p>
<table width="485" border="0" align="center" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td><img height="75" src="../images/top2.gif"
width="485" /></td>
</tr>
<tr>
<td background="../images/middle_bbg.gif"><table height="230" cellspacing="0" cellpadding="0" width="470" align="center"
background="../images/middle_bg.gif" border="0">
<tbody>
<tr>
<td valign="center" align="middle"><table cellspacing="2" cellpadding="2" width="474" border="0">
<tbody>
<tr>
<td width="466" height="41" class="font12B"> </td>
</tr>
<tr>
<td class="font12" height="32"><div align="center">用 户 名:<span class="STYLE1">
<input name="user" type="text" id="loginpwd" onKeyUp="form1.username.value=this.value" size="15" maxlength="20">
</span></div></td>
</tr>
<tr>
<td class="font12" height="17"><label for="saveName"></label></td>
</tr>
<tr>
<td class="font12" height="32"><div align="center">用户密码:<span class="STYLE1">
<input name="power" type="password" id="power" size="15" maxlength="20">
</span></div></td>
</tr>
<tr>
<td height="32"> </td>
</tr>
<tr>
<td height="30"><div align="center">
<input name="IP" type="hidden" id="IP" value="<% = Userip() %>">
<input name="username" type="hidden" id="username">
<input name="jilu" type="hidden" id="jilu" value="进入首页input.asp操作">
<input type="submit" name="Submit" value="进入学籍管理"style="width:133;background-color: #FFCC66; color: #000000; border: 1 solid #00CC00; height:27">
</div></td>
</tr>
<tr>
<td align="middle"><span class="STYLE9">注意,登录后所有操作,系统中仅有详细记录!</span></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td><img height="24" src="../images/bottom.gif"
width="485" /></td>
</tr>
</tbody>
</table>
<p align="center" class="STYLE3"> </p>
<input type="hidden" name="MM_insert" value="form1">
</form>
</body>
</html><%
Recordset1.Close()
Set Recordset1 = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -