📄 editnews.asp
字号:
<!--#include file="admin_is.ini"--><!--#include file="conn.asp"--><html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#799AE1">
<table width="80%" border="1" cellspacing="0" cellpadding="1" bordercolor="#336699" align="center">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="../images/back_3.gif" rowspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
<tr>
<td class="12v" >
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="96" width="100%">
<tr>
<td>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" height="128">
<tr>
<td height="20" bgcolor="#FFFFFF">
<div align="center"><font color="#000000">新闻管理</font></div>
</td>
</tr>
<tr>
<td height="2" valign="top" bgcolor="#E8F1FF"> <br>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="24">
<tr>
<td width="11%">ID</td>
<td width="15%">主题</td>
<td width="44%">内容</td>
<td width="9%">作者</td>
<td width="9%">时间</td>
<td width="12%">类别</td>
</tr>
</table>
<% set rs=server.createobject("adodb.recordset")
sql="SELECT * from news order by ntime desc"
rs.open sql,conn,1,3
page=1 ' 设置变量PAGE=1
rs.pagesize=20
if Not IsEmpty(Request("Page")) then '如果PAGE已经初始化...
Page = CInt(Request("Page")) '接收PAGE并化为数字型赋给PAGE变量
if Page > rs.PageCount then '如果接收的页数大于总页数
rs.AbsolutePage = rs.PageCount '设置当前显示页等于最后页
else
rs.AbsolutePage = Page '显示当前页等于接收的页数
end if
else
Page = 1 '如果page未被初始化则设为1
End if
rs.AbsolutePage=page
%>
<%
For i = 1 to rs.PageSize
if rs.EOF then
Exit For
end if '利用for next 循环依次读出记录
%>
<table width="100%" border="1" cellspacing="0" cellpadding="0" height="8" bgcolor="#FFFFFF" bordercolor="#CCCCCC">
<tr>
<td width="11%"><%=rs("id")%><img src="images/delete.gif" alt="删除" width="12" height="12" border="0" onClick="if(confirm('您确定要删除吗?')){location='delnews.asp?id=<%=rs("id")%>'}else{return(false)}" onMouseMove="this.style.cursor='hand'"></td>
<td width="15%"><a href="addnews2.asp?id=<%=rs("id")%>"><%=rs("nname")%></a></td>
<td width="44%"><%=rs("nneirong")%></td>
<td width="9%"><%=rs("zuozhe")%></td>
<td width="9%"><%=rs("ntime")%></td>
<td width="12%">
<% if rs("lei")=0 then %>
站内新闻
<% elseif rs("lei")=1 then %>
帮助中心
<% elseif rs("lei")=2 then %>
滚动新闻
<% end if %>
</td>
</tr>
</table>
<%rs.movenext
next %>
</td>
</tr>
<tr>
<td height="106" valign="top" bgcolor="#E8F1FF"><div align="right"><br>
<%if request("page")>1 then%>
<a Href="editnews.asp?Page=<% = 1%>">首页</a> <a Href="editnews.asp?Page=<% =request("page") -1 %>">上一页</a>
<%end if %>
<%if request("page")<>rs.pagecount then %>
<a Href="editnews.asp?Page=<% =request("page") + 1%>">下一页</a>
<a Href="editnews.asp?Page=<% = rs.PageCount%>">尾页</a>
<% end if %>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -