📄 index.asp
字号:
<!--#include file="book_conn.asp"-->
<HTML><HEAD>
<TITLE><%=sitename%></TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="description" content="<%=sitename%>">
<meta name="keywords" content="<%=sitename%>">
<link rel="stylesheet" href="book.css" type="text/css">
<style type="text/css">
<!--
.STYLE2 {color: #FFFFFF}
a:link {
color: #FFFFFF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #CCCCCC;
}
a:hover {
text-decoration: underline;
color: #FFFFFF;
}
a:active {
text-decoration: none;
color: #CCCCCC;
}
.STYLE3 {color: #FFFFFF}
body {
background-color: #000000;
}
-->
</style>
</HEAD>
<center>
<!--#include file="book_top.asp"-->
<table width="760" border=0 cellspacing=0 cellpadding=0 align=center bgcolor="#000000" class="grayline">
<tr><td align=center height=50>
<a href=book_write.asp><span class="STYLE2"><img border=0 src=images/write.gif title="我要写留言"></span></a> <span class="STYLE2"> <a href=index.asp><img border=0 src=images/read.gif title="留言本首页"></a>
</span></td>
</tr>
<tr><td>
<%
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from Feedback where online='1' order by top desc,Postdate desc"
rs.open sql,conn,1
if rs.eof and rs.bof then response.redirect "book_write.asp"
if pages=0 or pages="" then pages=10 '每页留言条数
rs.pageSize = pages '每页记录数
allPages = rs.pageCount '总页数
page = Request("page") '从浏览器取得当前页
'if是基本的出错处理
If not isNumeric(page) then page=1
if isEmpty(page) or Cint(page) < 1 then
page = 1
elseif Cint(page) >= allPages then
page = allPages
end if
rs.AbsolutePage = page '转到某页头部
Do While Not rs.eof and pages>0
UserName=rs("UserName") '用户名
pic=rs("pic") '头像
face=rs("face") '表情
Comments=rs("Comments") '内容
bad1=split(bad,"/") '过滤脏话
for t=0 to ubound(bad1)
Comments=replace(Comments,bad1(t),"***")
next
Replay=rs("Replay") '回复
Usermail=rs("Usermail") '邮件
url=rs("url") '主页
I=I+1 '序号
temp=RS.RecordCount-(page-1)*rs.pageSize-I+1
%>
<table width="680" border="1" align="center" cellPadding="1" cellSpacing="1" bordercolor="#000000" bgColor="#FFFFFF">
<tr>
<td vAlign="top" width="25%" bgColor="#000000" rowSpan="2" align=center>
<table width=80% border=0 bgcolor="#">
<tr><td align=center bgcolor="#000000"><img src=images/face/pic<%=pic%>.gif border=0></td>
</tr>
<tr><td bgcolor="#000000"><span class="STYLE2">姓名:<%=UserName%><br>
来自:<%=left(rs("ip"),(len(rs("ip"))-1))+"*"%><br>
邮件:<a href=mailto:<%=Usermail%>><img src=images/mail.gif border=0></a><br>
主页:<a href="<%=URL%>" target='_blank'><img src=images/home.gif border=0></a></span><a href="<%=URL%>" target='_blank'></a></td>
</tr>
</table>
</td>
<td width="75%" height="20" bgColor="#000000">[<span class="STYLE3">NO.<%=temp%>] <img border=0 src=images/face/face<%=face%>.gif> 发表于:<%=cstr(rs("Postdate"))%></span></td>
</tr>
<tr>
<td vAlign="top" bgColor="#000000" width='758' height=120 onMouseOver="bgColor='#000000'" onMouseOut="bgColor='#000000'">
<span class="STYLE2">
<%
'是否屏蔽留言内容中的html字符
if html=0 then
response.write replace(server.htmlencode(Comments),vbCRLF,"<BR>")
else
response.write replace(Comments,vbCRLF,"<BR>")
end if
%>
<br>
<br>
<%if rs("Replay")<>"" then%>
</span>
<table cellSpacing="1" cellPadding="3" width="90%" align="center" bgColor="#ffffff" border="0">
<tr><td vAlign="top" bgColor="#000000" class="STYLE2"> <%=huifutishi%>:<br> <%=Replay%>
</td>
</tr></table>
<span class="STYLE2"><br>
<%end if%>
</span></td>
</tr>
</table>
<table cellSpacing="0" cellPadding="0" width="760" align="center" bgColor="#000000" border="0">
<TR><TD height=2> </TD></TR></TABLE>
<%
pages = pages - 1
rs.movenext
if rs.eof then exit do
loop
%>
</td></tr>
<tr><td height=50 valign=top>
<span class="STYLE3">
<%
response.write "<br> 总计留言"&RS.RecordCount&"条 "
if page = 1 then
response.write "<font color=darkgray>首页 前页</font>"
else
response.write "<a href="&request.ServerVariables("script_name")&"?page=1>首页</a> <a href="&request.ServerVariables("script_name")&"?page="&page-1&">前页</a>"
end if
if page = allpages then
response.write "<font color=darkgray> 下页 末页</font>"
else
response.write " <a href="&request.ServerVariables("script_name")&"?page="&page+1&">下页</a> <a href="&request.ServerVariables("script_name")&"?page="&allpages&">末页</a>"
end if
response.write " 第"&page&"页 共"&allpages&"页 "
%>
</span></td>
</tr>
</table>
</td></tr>
</table>
<!--#include file="book_down.asp"-->
</center>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -