📄 a_news.asp
字号:
<%@LANGUAGE="VBScript" codepage="936"%>
<%
'**********************************************************
' zhuzhu 1.0 Free Power by zgrq.com
' Email:ringsbot@163.com OICQ:500985
' 网站: http://www.zgrq.com 演示:http://www.zgrq.com
'**********************************************************
if session("admin")<>"" and Request.Cookies("admin")<>"" then%>
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Page-Exit" content="revealTrans(Duration=1.0,Transition=12)">
<link href="skin_1.css" rel="stylesheet" type="text/css">
<STYLE type="text/css">
body {
scrollbar-face-color: #EFEFEF;
scrollbar-shadow-color: #999999;
scrollbar-highlight-color: #999999;
scrollbar-3dlight-color: #FFFFFF;
scrollbar-darkshadow-color: #FFFFFF;
scrollbar-track-color: #FFFFFF;
scrollbar-arrow-color: #999999;
}
.re {
background-color: #FFFFFF;
margin: 4px;
padding: 4px;
border: 1px dotted #006699;
}
</STYLE>
<title>Ranran</title>
<link href="style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
dim rs
dim sql
msg_per_page = 20 '定义每页显示记录条数
set rs = server.createobject("adodb.recordset")
sql ="select * from [news] order by id desc" 'ranran
rs.cursorlocation = 3 '使用客户端游标,可以使效率提高
rs.pagesize = msg_per_page 'http://www.21wan.cn
rs.open sql,conn,0,1
if err.number<>0 then '错误处理
response.write "数据库操作失败:" & err.description
err.clear
else
if not (rs.eof and rs.bof) then '检测记录集是否为空
totalrec = RS.RecordCount 'totalrec:总记录条数
if rs.recordcount mod msg_per_page = 0 then '计算总页数,recordcount:数据的总记录数
n = rs.recordcount\msg_per_page 'n:总页数
else
n = rs.recordcount\msg_per_page+1
end if
currentpage = request("page") 'http://www.21wan.cn
If currentpage <> "" then
currentpage = cint(currentpage)
if currentpage < 1 then
currentpage = 1
end if
if err.number <> 0 then
err.clear
currentpage = 1
end if
else
currentpage = 1
End if
if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then
currentPage=1
end if
rs.absolutepage = currentpage 'absolutepage:设置指针指向某页开头 QQ:1019257
rowcount = rs.pagesize 'pagesize:设置每一页的数据记录数 茫然
dim i
dim k
%>
<%do while not rs.eof and rowcount > 0%>
<table width="310" border="0" cellspacing="0">
<tr>
<td><table width="306" border="0" align="center" cellspacing="0">
<tr>
<td width="77%" height="20"> <a href="n_redit.asp?id=<%=rs("id")%>"><%=rs("title")%></a></td>
<td width="23%"> <div align="right"><a href="n_redit.asp?id=<%=rs("id")%>">修改</a> <a href="del.asp?id=<%=rs("id")%>" onclick="return confirm('是否确定删除本留言?');">删除</a></div></td>
</tr>
<tr>
<td height="1" colspan="2" background="images/bg_dian.gif"></td>
</tr>
</table></td>
</tr>
</table>
<%
rowcount=rowcount-1
rs.MoveNext
loop
end if
end if
rs.close
set rs=nothing
%>
</table>
<table border="0" align=right>
<tr>
<td valign="middle" align=right>
<%call listPages()%>
</td>
</tr>
</table>
</body>
</html>
<%
sub listPages()
'if n <= 1 then exit sub
for i=0 to n\msg_per_page-1
for j=1 to msg_per_page
%>
<font size="2" color="#006600">
<a href="<%=request.ServerVariables("script_name")%>?page=<%=i*msg_per_page+j %>">
[<% =i*msg_per_page+j %>]</a></font>
<%
next
next
EndPage = n mod msg_per_page
for j=1 to EndPage
%>
<font size="2" color="#006600">
<a href="<%=request.ServerVariables("script_name")%>?page=<% =i*msg_per_page+j %>">
[<% =i*msg_per_page+j %>]</a></font>
<%next%>
<font color=black face="arial" >
<br>当前页:<font color=#FF000000><%=currentpage%>/<%=n%></font> 文章总数:<font color=#FF000000><%=totalrec%></font> 条
</font>每页显示:<font color=#FF000000>20</font><font color=black face="arial" > </font>条
<%end sub%>
<%
else
response.Redirect("a_admin.asp")
end if
'**********************************************************
' zhuzhu 1.0 Free Power by zgrq.com
' Email:ringsbot@163.com OICQ:500985
' 网站: http://www.zgrq.com 演示:http://www.zgrq.com
'**********************************************************
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -