📄 managenews.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/conn.asp" -->
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="admin,news"
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
%>
<%
set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_conn_STRING
rs.Source = "SELECT * FROM news ORDER BY newid DESC"
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
%>
<%
' *** 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">
<link rel="stylesheet" href="ddd.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0">
<!--#include file="manage.asp" -->
<!--#include file="top.asp" -->
<table width="771" border="0" cellspacing="0" cellpadding="0" align="center" class="bk">
<tr>
<td>
<div align="center"><a href="addnews.asp"><br>
增加新闻</a><br>
<br>
<form name="form1" method="get" action="delnews.asp">
<table width="570" border="1" cellspacing="2" cellpadding="0" align="center" bordercolor="#FFFFFF" class="dfont">
<tr bordercolor="#000000" bgcolor="#99CC00">
<td width="442">
<div align="center"><b><font color="#000000" size="2">新闻标题</font></b></div>
</td>
<td width="79">
<div align="center"><b><font color="#000000" size="2">更新</font></b></div>
</td>
<td width="49">
<div align="center"><b><font color="#000000" size="2">删除</font></b></div>
</td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rs.EOF))
%>
<tr bordercolor="#000000">
<td width="442">
<div align="center"><%=(rs.Fields.Item("title").Value)%></div>
</td>
<td width="79">
<div align="center"><A HREF="upnews.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "newid=" & rs.Fields.Item("newid").Value %>">更新</A></div>
</td>
<td width="49">
<div align="center">
<input type="checkbox" name="newid" value="<%=(rs.Fields.Item("newid").Value)%>">
</div>
</td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs.MoveNext()
Wend
%>
<tr bordercolor="#000000">
<td colspan="3">
<div align="center">
<input type="submit" name="Submit" value="删除">
</div>
</td>
</tr>
</table>
<br>
</form>
</div>
</td>
</tr>
</table>
<br>
<!--#include file="bottom.asp" --></body>
</html>
<%
rs.Close()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -