📄 deluser.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/conn.asp" -->
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="admin,user"
MM_authFailedURL="adminloginerr.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
<%
' *** Edit Operations: declare variables
MM_editAction = CStr(Request("URL"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Delete Record: declare variables
if (CStr(Request("MM_delete")) <> "" And CStr(Request("MM_recordId")) <> "") Then
MM_editConnection = MM_conn_STRING
MM_editTable = "user"
MM_editColumn = "id"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = "manageuser.asp"
' 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
%>
<%
' *** Delete Record: construct a sql delete statement and execute it
If (CStr(Request("MM_delete")) <> "" And CStr(Request("MM_recordId")) <> "") Then
' create the sql delete statement
MM_editQuery = "delete from " & MM_editTable & " where " & MM_editColumn & " = " & MM_recordId
If (Not MM_abortEdit) Then
' execute the delete
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 rs__MMColParam
rs__MMColParam = "1"
if (Request.QueryString("id") <> "") then rs__MMColParam = Request.QueryString("id")
%>
<%
set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_conn_STRING
rs.Source = "SELECT * FROM user WHERE id = " + Replace(rs__MMColParam, "'", "''") + ""
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 3
rs.Open()
rs_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 15
Dim Repeat1__index
Repeat1__index = 0
rs_numRows = rs_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
' set the record count
rs_total = rs.RecordCount
' set the number of rows displayed on this page
If (rs_numRows < 0) Then
rs_numRows = rs_total
Elseif (rs_numRows = 0) Then
rs_numRows = 1
End If
' set the first and last displayed record
rs_first = 1
rs_last = rs_first + rs_numRows - 1
' if we have the correct record count, check the other stats
If (rs_total <> -1) Then
If (rs_first > rs_total) Then rs_first = rs_total
If (rs_last > rs_total) Then rs_last = rs_total
If (rs_numRows > rs_total) Then rs_numRows = rs_total
End If
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<html>
<head>
<title>用户管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
//-->
</script>
<link rel="stylesheet" href="ddd.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="manage.asp" -->
<!--#include file="top.asp" -->
<div align="center"></div>
<table width="771" border="0" cellspacing="0" cellpadding="0" align="center" class="bk">
<tr>
<td> <br>
<form name="form1" method="POST" action="<%=MM_editAction%>">
<table width="465" border="1" cellspacing="2 " cellpadding="0" align="center" bordercolor="#FFFFFF">
<tr>
<td background="images/bg22.gif" bordercolor="#000000">
<div align="center"><font color="#FF0000"><b><font size="2" color="#000000">用户删除</font></b></font></div>
</td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">用户名:<%=(rs.Fields.Item("user").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">密码:<%=(rs.Fields.Item("password").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">EMAIL:<%=(rs.Fields.Item("email").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">密码问题:<%=(rs.Fields.Item("panswer").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">密码答案:<%=(rs.Fields.Item("pquestion").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">真实名称:<%=(rs.Fields.Item("username").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">性别:<%=(rs.Fields.Item("xingbie").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">电话号码:<%=(rs.Fields.Item("phone").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">邮政编码:<%=(rs.Fields.Item("zip").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">所在城市:<%=(rs.Fields.Item("city").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">身份证号码:<%=(rs.Fields.Item("snumber").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">详细地址:<%=(rs.Fields.Item("address").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">注册时间:<%=(rs.Fields.Item("regdate").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="3">登录次数:<%=(rs.Fields.Item("loginshu").Value)%></font></b></td>
</tr>
<tr>
<td bordercolor="#000000"><b><font size="2"></font></b></td>
</tr>
<tr>
<td bordercolor="#000000">
<div align="center"> <font size="2"><b>
<input type="submit" name="Submit" value="删除">
<a href="manageuser.asp">返回</a></b></font></div>
</td>
</tr>
</table>
<input type="hidden" name="MM_delete" value="true">
<input type="hidden" name="MM_recordId" value="<%= rs.Fields.Item("id").Value %>">
</form>
<br>
<p align="center"> </p>
<p> </p>
</td>
</tr>
</table>
<br><!--#include file="bottom.asp" -->
</body>
</html>
<%
rs.Close()
%>
<html></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -