📄 book.asp
字号:
<!--#include file="bkconn.asp"-->
<!--#include file="inc/char.inc"-->
<html>
<head>
<STYLE>BODY {
FONT-SIZE: 9pt
}
TD {
FONT-SIZE: 9pt
}
a { text-decoration: none; color: #000000 }
a:hover { text-decoration: underline; color: #0000FF }
</STYLE>
<%
const MaxPerPage=10 '分页显示的纪录个数
dim sql
dim rs
dim gstBookID
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<title>网友留言簿</title>
</head>
<body background="002.gif">
<div align="center"><img src="guestbook.gif" WIDTH="283" HEIGHT="60">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from book order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
showpages
response.write "<p align='center'> 还 没 有 任 何 留 言</p>"
else
totalPut=rs.recordcount '记录总数
if currentPage=1 then
showpages
showContent
showpages
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark '移动到开始显示的记录位置
showpages
showContent
showpages
else
currentPage=1
showContent
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
dim i
i=0
%>
<%
do while not (rs.eof or err)
%>
</div>
<div align="center"><center>
<table border="0" width="730" cellspacing="1" cellpadding="20">
<tr>
<td width="100%"><p align="center"><font color="#000080"><strong>
<img src="g13.gif" WIDTH="15" HEIGHT="15"> <%
if rs("contenttop")<>"" then
if rs("content")<>"" then
contop=rs("contenttop")
Response.Write contop
else
contop=rs("contenttop") & "<span style='font-size: 9pt'><font color='#408080'></strong>(无内容)</span>"
Response.Write contop
end if
else
contop=rs("name") & "留言说<span style='font-size: 9pt'><font color='#408080'></strong>(无主题)</span>"
Response.Write contop
end if
%>
</strong></font></td>
</tr>
</table>
</center></div><div align="center"><center>
<table border="0" cellspacing="1" height="1" width="730" bgcolor="#0000FF">
<tr>
<td nowrap valign="middle" class="aa" bgcolor="#EED18E" width="80">
<p align="left"><font color="#000000"><img src="r.gif" WIDTH="15" HEIGHT="13">
大 名</font>
</td>
<td nowrap valign="middle" class="aa" bgcolor="#FFFFFF" width="643">
<p align="left"><font color="#000000"><%
if rs("sex")<>"不想说" then
name=rs("name") & "<span style='font-size: 9pt'>(" & rs("sex") & ")</span>"
else
name=rs("name")
end if
Response.Write name
%> </font></td>
</tr>
<% if rs("fromwhere")<>"" then %>
<tr>
<td nowrap valign="middle" class="aa" bgcolor="#EED18E" width="80">
<p align="left"><font color="#000000"><img src="r.gif" WIDTH="15" HEIGHT="13">
来 自</font>
</td>
<td nowrap valign="middle" class="aa" bgcolor="#FFFFFF" width="643">
<p align="left"><font color="#000000"><% display rs("fromwhere") %> </font></td>
</tr>
<%
end if
if rs("email")<>"" then
%>
<tr>
<td nowrap valign="middle" class="aa" bgcolor="#EED18E" width="80">
<p align="left"><font color="#000000"><img src="r.gif" WIDTH="15" HEIGHT="13">
邮 箱</font>
</td>
<td nowrap valign="middle" class="aa" bgcolor="#FFFFFF" width="643">
<p align="left"><font color="#000000"><span style="font-size: 9pt"><a href="mailto:<% display rs("email") %>"><% display rs("email") %> </a></span></font></td>
</tr>
<%
end if
if rs("homepage")<>"" and rs("homepage")<>"http://" then
%>
<tr>
<td nowrap valign="middle" class="aa" bgcolor="#EED18E" width="80">
<p align="left"><font color="#000000"><img src="r.gif" WIDTH="15" HEIGHT="13">
主 页</font>
</td>
<td nowrap valign="middle" class="aa" bgcolor="#FFFFFF" width="643">
<p align="left"><font color="#000000"><span style="font-size: 9pt"><a href="<% display rs("homepage") %>" target="_blank"><% display rs("homepage") %> </a></span></font></td>
</tr>
<%
end if
%>
<tr>
<td nowrap valign="middle" class="aa" bgcolor="#EED18E" width="80">
<p align="left"><font color="#000000"><img src="r.gif" WIDTH="15" HEIGHT="13">
时 间</font>
</td>
<td nowrap valign="middle" class="aa" bgcolor="#FFFFFF" width="643">
<p align="left"><font color="#000000"><span style="font-size: 9pt"><%
=rs("dateandtime")
%> </span></font></td>
</tr>
<%
if rs("content")<>"" then
%>
<tr>
<td nowrap valign="top" class="aa" bgcolor="#EED18E" width="80">
<p align="left"><font color="#000000"><img src="r.gif" WIDTH="15" HEIGHT="13">
留 言</font>
</td>
<td nowrap class="aa" bgcolor="#FFFFFF" width="643">
<p align="left"><font color="#000000"><%
display rs("content")
' Response.Write rs("content")
%></font></td>
</tr>
<%
end if
if rs("anser")<>"" then%>
<%sss=cstr(rs("id"))+"abc"%>
<tr>
<td align="right" bgcolor="#F8EACB" width="80">
<p align="center"><font color="#8080FF"><span style="font-size: 9pt">回复留言</span></font></td>
<td valign="top" align="right" bgcolor="#FFFFFF" width="643">
<p align="left"><font color="#8080FF"><span style="font-size: 9pt">[<%Response.Write rs("ansertime")%>]<br>
<%
display rs("anser")
'Response.Write rs("anser")
%> </span></font></td>
</tr>
<%end if%>
</table>
</center></div>
<%
i=i+1
if i>=MaxPerPage then exit do '循环时如果到尾部则先退出,如果记录达到页最大显示数,也退出
rs.movenext
loop
end sub
sub showpages()
%>
<br>
<br>
<form Action="book.asp" Method="GET" align="right">
<div align="center"><center><table border="1" width="730" bgcolor="#EED18E" bordercolorlight="#DFA92B" bordercolordark="#F8EACB" cellspacing="1">
<tr>
<td width="100%">
<p align="center"><span style="font-size: 9pt"><a href="../">[返回主页]</a>
<a href="inputform.htm">[我要留言]</a>
<%
If currentPage <> 1 Then
Response.Write "<A HREF=book.asp>[第一页]</A> "
Response.Write "<A HREF=book.asp?Page=" & (currentPage-1) & ">[上一页]</A> "
End If
If currentPage <> rs.PageCount Then
Response.Write "<A HREF=book.asp?Page=" & (currentPage+1) & ">[下一页]</A> "
Response.Write "<A HREF=book.asp?Page=" & rs.PageCount & ">[最后一页]</A> "
End If
%>
<img src="w.gif" WIDTH="16" HEIGHT="16"><font color="#000000">第</font><font color="#FF0000"><%=currentPage%></font><font color="#000000">页,共</font><font color="#FF0000"><%=rs.PageCount%></font><font color="#000000">页
<img src="w.gif" WIDTH="16" HEIGHT="16">转到第
<input TYPE="TEXT" Name="Page" SIZE="3">
页
</font> </span>
<input name="Submit1" src style="BACKGROUND-COLOR: #feac37; BORDER-BOTTOM: #000875 1px solid; BORDER-LEFT: #9aa3ff 1px solid; BORDER-RIGHT: #000875 1px solid; BORDER-TOP: #9aa3ff 1px solid; COLOR: #efefef; HEIGHT: 20px" type="submit" value=" GO ">
</td>
</tr>
</table>
</center></div>
</form>
<%
end sub
%>
<!--#include file="inc/ads.inc"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -