📄 index.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../public/conn.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查看留言</title>
<link href="../mycss.css" rel="stylesheet" type="text/css">
</head>
<body>
<!--#include file="../public/top.asp" -->
<table width="760" border="1" align="center" cellpadding="5" cellspacing="1" class="font9Black">
<tr>
<td height="206" valign="top"><div align="center">
<h3>查看留言</h3>
<%if not session("username")="" then%>
<p align="center"><a href="leavewords.asp">我要留言</a></p>
<%end if%>
<hr width="70%" size="1">
<%
if not isempty(request("page")) then
Page=cint(request("page"))
else
Page=1
end if
set rs1=server.createobject("adodb.recordset")
sql1 ="select * from guestbook"
rs1.open sql1,secondconn,1,1
if rs1.eof and rs1.bof then
response.write "<p align='center'>【<a href='javascript:window.close()'>关闭窗口</a>】"
else
const maxperpage=10
rs1.pagesize=maxperpage
totalrecord=rs1.recordcount
totalpage=rs1.pagecount
if page>totalpage then page=totalpage
rs1.absolutepage=page
i=0
dim id(),author(),content(),leavetime(),replycontent(),replytime(),replyauthor()
do while not rs1.eof and (i<rs1.pagesize)
i=i+1
redim preserve id(i),author(i),content(i),leavetime(i),replycontent(i),replytime(i),replyauthor(i)
id(i)=rs1("id")
author(i)=rs1("author")
content(i)=rs1("content")
leavetime(i)=rs1("time")
replycontent(i)=rs1("replycontent")
replytime(i)=rs1("replytime")
replyauthor(i)=rs1("replyauthor")
rs1.movenext
loop
end if
rs1.close
set rs1=nothing
%>
<%for i = totalrecord to 1 step -1%>
<table width="70%" border="0" cellpadding="5" cellspacing="1" bgcolor="#333333">
<tr>
<td width="77%" bgcolor="#FFFFFF"><div align="left">第<%=i%>条 <%=author(i)%> 于<%=leavetime(i)%>留言</div></td>
<%if session("quanxian")="master" then%><td width="23%" bgcolor="#FFFFFF"><div align="center"><a href="reply.asp?id=<%=id(i)%>">回复</a> <a href="del.asp?id=<%=id(i)%>">删除</a></div></td><%end if%>
</tr>
<tr>
<td colspan="2" bgcolor="#FFFFFF"><div align="left"><%=content(i)%></div></td>
</tr>
<%if not replycontent(i)="无" then%>
<tr>
<td colspan="2" bgcolor="#FFFFFF"><div align="left">管理员<%=replyauthor(i)%>于<%=replytime(i)%>日回复</div></td>
</tr>
<tr>
<td colspan="2" bgcolor="#FFFFFF"><div align="left"><%=replycontent(i)%></div></td>
</tr>
<%end if%>
</table>
<br>
<%next%>
<table width="100%" border="0" cellspacing="1" cellpadding="5">
<tr>
<td>
<div align="center"> 共有<%=totalrecord%>条记录, 每页<%=maxperpage%>条,共<font color=red><%=totalpage%></font>页 第<%=page%>页
<%if page-1>0 then%>
<a href="index.asp?page=<%=page-1%>">上一页</a>
<%else%>
上一页
<%end if%>
<%if page+1<=totalpage then%>
<a href="index.asp?page=<%=page+1%>">下一页</a>
<%else%>
下一页
<%end if%>
</div></td>
</tr>
</table>
</div></td>
</tr>
</table>
<!--#include file="../public/bottom.asp" -->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -