📄 untitled.asp
字号:
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>AH's个人站====>文章列表</title>
</head>
<!--#include file="head.asp"-->
<%Const MaxPerPage=10%>
<%
dim rs,sql
dim totalPut
dim CurrentPage, TotalPages
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
set rs = server.createobject("adodb.recordset")
%>
<body background="../img/dnacebg2.jpg" topmargin="0" leftmargin="0">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="616" bgcolor="#B3B3B3">
<tr>
<td width="3%" background="../img/dnacebg3.jpg">
<div align="center">
</div>
</td>
<td width="94%" height="500" background="../img/dnacebg.jpg"><table width="560" height="1" border="0" cellpadding="0" cellspacing="0" background="../img/dnacebg.jpg">
<tr background="../img/dnacebg.jpg">
<td width="588" height="18" colspan="4" valign="bottom" bgcolor="#6600CC"><p align="center"><font size="2" color="#FFFFFF">文 章 列 表</font></td>
</tr>
<tr>
<td width="64" height="18" valign="bottom"><font size="2">编 号</font></td>
<td width="313" height="2" valign="bottom"><p align="center"><font size="2">文 章 标 题</font></td>
<td width="74" height="2" valign="bottom"><p align="center"><font size="2">点 击 次 数</font></td>
<td width="136" height="2" valign="bottom"><p align="right"><font size="2">添 加 时 间</font></td>
</tr>
<center>
<center>
<tr>
<td width="588" colspan="4" height="25"><hr style="border-style: dotted" color="#008080">
</td>
</tr>
</center>
</center>
<tr>
<td width="588" colspan="4" height="1"><center>
<center>
<%
sql="select * from article order by date desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>没有找到相关的文章</p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"index.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
showContent
showpage totalput,MaxPerPage,"index.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"index.asp"
end if
end if
rs.close
end if
sub showContent
dim i
i=0
do while not rs.eof
%>
</center>
</center>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="590">
<tr>
<center>
<center>
<center>
<td width="65"><%=i+1%></td>
<td width="312"><p align="center"> <a href="list.asp?id=<%=rs("id")%>" target="_blank">
<%
title=rs("title")
if len(title)>30 then
title=left(title,30) & "....."
end if
response.write title
%>
</a></td>
<td width="81"><p align="center"><%=rs("hits")%></td>
</center>
</center>
</center>
<td width="130"><p align="right"><%=rs("date")%></td>
</tr>
<center>
<center>
<center>
<tr>
<td width="588" colspan="4"><hr style="border-style: dotted" color="#008080">
</td>
</tr>
</center>
</center>
</center>
</table>
</div>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
end sub
%>
</td>
</tr>
<tr>
<td width="400" colspan="4" height="18" align="left"><%
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<p align='center'>"
if CurrentPage<2 then
response.write "<form method='post' action='search.asp'>"
response.write "<font color='#000080'>首页 | 上一页</font> | "
else
response.write "<a href="&filename&"?page=1>首页</a> | "
response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a> | "
end if
if n-currentpage<1 then
response.write "<font color='#000080'>下一页 | 尾页</font>"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
response.write "下一页</a> | <a href="&filename&"?page="&n&">尾页</a>"
end if
response.write "<font color='#000080'> 页次:</font><strong><font color=red>"&CurrentPage&"</font><font color='#000080'>/"&n&"</strong>页</font> "
response.write "<font color='#000080'> 共<b>"&totalnumber&"</b>篇文章 <b>"&maxperpage&"</b>文章/页</font>"
response.write "<input type='text' name='keyword' size='15' style=background-color: #B3B3B3; border-style: dotted; border-color: #000000>"
response.write "<input type='submit' name='submit' value='搜索'>"
response.write "</form>"
%>
<%
end function
%>
</tr>
</table></td>
<td width="3%" background="../img/dnacebg3.jpg"> </td>
</tr>
<tr>
<td height="20" colspan="3" background="../img/dnacebg3.jpg">
</td>
</tr>
</table>
</div>
</body>
</html
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -