📄 guest.asp
字号:
<!--#include file="dbpath/dbpath.asp"-->
<html>
<head>
<title>.::爱坠红尘留言本::.</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
dim MaxPerPage
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
%>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script language="JavaScript">
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
//-->
</script>
<style type="text/css">
<!--
body,td,th {
color: #000000;
}
body {
background-image: url(12.gif);
}
.style1 {color: #cc0033}
-->
</style></head>
<body leftmargin="0" topmargin="0" marginwidth="0">
<table border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><img src="IMAGES/top.jpg" width="550" height="185"></td>
</tr>
<tr>
<td><table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25" valign="top"><div align="right"></div></td>
</tr>
<tr>
<td>
</span></td>
</tr>
<tr>
<td><table width="455" border="0" align="center" cellpadding="0" cellspacing="0" class="border2" >
</table>
<span >
<%
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 %>
</span>
<div align="center" ><font color="#FF3366" >还 没 有 任 何 留 言</font>
<% else
rs.pagesize=8
totalPut=rs.recordcount '记录总数
totalPage=rs.pagecount
MaxPerPage=rs.pagesize
if currentpage<1 then
currentpage=1
end if
if currentpage>totalPage then
currentpage=totalPage
end if
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
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
dim i
dim k
k=(totalPut-MaxPerPage*(currentPage-1))+1
i=0
%>
<%
do while not (rs.eof or err)
k=k-1
%>
<table width="455" border="0" align="center" cellpadding="0" cellspacing="0" >
</table></td>
</tr>
<tr>
<td><span >
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<table width="455" border="0" align="center" cellpadding="0" cellspacing="0" background="bg.gif">
<tr>
<td class="border2">
<table width="450" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="40" rowspan="2"> <img
src="<%=rs("face")%>"></td>
<td width="415" height="10"><font color="#000000" size="1"> No.<%=k%></font></td>
</tr>
<tr>
<td width="415" height="15"><b><font color="#cc0033"><%=rs("name")%></font></b> </td>
</tr>
<tr>
<td colspan="2"><%=rs("Memo")%>
</table>
</td>
</tr>
<tr>
<td>
<table width="455" border="0" cellspacing="0" cellpadding="0" align="center" >
<tr>
<td width="75" class="titel" >
<div align="center" class="EFONT"><a title="主页:[ <%=rs("homepage")%> ]" href="<%=rs("homepage")%>" target="_blank">Homepage</a></div>
</td>
<td width="40" class="titel" >
<div align="center" class="EFONT"><a title="E-mail:[ <%=rs("email")%> ]" href="mailto:<%=rs("email")%>">Email</a></div>
</td>
<td width="40" class="titel" >
<div align="center" class="EFONT" ><a title="QQ号码:[ <%=rs("oicq")%> ]" href="javascript:;" onClick="MM_popupMsg('QQ号码:[ <%=rs("oicq")%> ]')">OICQ</a></div>
</td>
<td class="titel" width="30">
<div align="right"><font color="#000000" class="EFONT">
<% if rs("ip")<>"" then %>
</font><font class="EFONT" color="##000000"><span class="titel">IP</span></font><font color="#000000"><span class="titel"><font class="EFONT">
:</font></span></font><font color="#000000" class="EFONT">
</font></div>
</td>
<td class="font1">
<div align="center"><font font color="#000000" class="EFONT">
<% = rs("ip") %>
</font></div>
</td>
<td class="titel" width="45">
<div align="right"><font color="#000000" class="EFONT">
<% end if %>
</font><font class="EFONT"><font color="#000000" class="titel"><span class="titel">time
:</span></font></font><span class="titel"><font color="#000000" class="EFONT">
</font></span><font color="#000000" class="EFONT"> </font></div>
</td>
<td class="font1" width="125">
<div align="right"><font color="#000000" class="EFONT">
<% =rs("time") %>
</font></div><td height="10"> </td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="455" border="0" align="center" cellpadding="0" cellspacing="0" >
<%
if rs("anser")<>"" then%>
<tr valign="middle">
<span class="style1"><b>斑竹回复</b>:<font color="#CC0033"><%=rs("anser")%></td>
</tr>
<%end if%>
</table>
</td>
</tr>
<tr>
<td height="10"> </td>
</tr>
<tr>
</tr>
</table>
<span >
<%
i=i+1
if i>=MaxPerPage then exit do '循环时如果到尾部则先退出,如果记录达到页最大显示数,也退出
rs.movenext
loop
end sub
sub showpages()
dim n
n=totalPage
%>
</span>
<table width="425" border="0" align="center" cellpadding="0" cellspacing="0" class="border2" >
<td height="30" valign="bottom"> <div align="right"><a href="guestbook.asp">签写留言</a> | <a href="manage.asp">版主管理</a>
</div>
<td height="30" valign="bottom" class="font2">
<font size="1">Pages:</span></div>
</td>
<td height="30" valign="bottom" class="font2"><font size="1"><%
If currentPage <> 1 Then
Response.Write "<A HREF=guest.asp?Page=" & (currentPage-1) & "><font face='宋体' size='1'> </font></A> "
End If
%><%
if rs.pagecount <= 8 then
for i=1 to rs.pagecount
response.write "<a href='guest.asp?page="&i&"'>"&i&"</a> "
next
else
for i=1 to 8
response.write "<a href='guest.asp?page="&i&"'>"&i&"</a> "
next
end if
%><%
If currentPage <> rs.PageCount Then
Response.Write "<A HREF=guest.asp?Page=" & (currentPage+1) & "><font face='Verdana' size='1'> next</font></A> "
End If
%> Total:<A HREF=guest.asp?Page=<%=totalPage%>><%=totalPage%></A></font></span></td>
</TR>
</TBODY>
</table>
</div>
<%
end sub
%>
<TABLE width="550" border="0" cellspacing="0" cellpadding="0" align="center" class="border2" height="70">
<td background="images/topd.gif">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="76%" height="70"></td>
<td width="24%" height="70">
<p align="center"><a href="http://lovehc.yeah.net"><img border="0" src="http://www.86861.01www.net/hclogo.gif" alt="::愛墜紅塵::" width="88" height="31"></a></td>
</tr>
</table>
</td>
</TABLE>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -