⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guest.asp

📁 不用注册也可以发言
💻 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);
// -->
//-->
</script>
<STYLE>
BODY {
SCROLLBAR-FACE-COLOR: #ffffff;
 SCROLLBAR-HIGHLIGHT-COLOR: #ffffff;
 SCROLLBAR-SHADOW-COLOR: #ffffff;
 SCROLLBAR-3DLIGHT-COLOR: #ffffff;
 SCROLLBAR-ARROW-COLOR: #000000;
 SCROLLBAR-TRACK-COLOR: #ffffff;
 SCROLLBAR-DARKSHADOW-COLOR: #ffffff;
 SCROLLBAR-BASE-COLOR: #ffffff
}
</STYLE>
</head>

<body leftmargin="0" marginwidth="0" topmargin="0">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="border2">
  <tr> 
    <td width="500"><span > </span>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF" height="16">
        <tr> 
          <td width="251" bgcolor="#FFFFFF" class="font2"> <div align="left" class="border3"><font color="#CCCCCC"><a href="guestbook.asp">签写留言</a> 
              <a href="manage.asp">斑竹管理</a> </font></div></td>
        </tr>
      </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="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#DDDDDD" align="center">
          <tr> 
            <td class="border2"> 
              <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="border3">
                <tr> 
                  <td width="824" align="center" class="border3">
<div align="left"><font class="EFONT"> 
                      <span class="border3">No.</span><%=k%>   <%=rs("name")%> 
                      <img 
    src="<%=rs("txthead")%>" ></font></div></td>
                </tr>
                <tr> 
                  <td rowspan="4" background="bg.gif" class="font"> 
                    <p align="left" style="line-height: 178%"><%=rs("Memo")%></td>
                </tr>
                <tr> </tr>
                <tr> </tr>
                <tr> </tr>
                <tr>                
                </tr>
              </table>
            </td>
          </tr>
          <tr> 
            <td bgcolor="#FFFFFF"> 
              <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF" >
                <tr class="border3"> 
                  <td width="63" > 
                    <div align="center" class="EFONT"><a title="主页:[ <%=rs("homepage")%> ]" href="<%=rs("homepage")%>" target="_blank">Home</a></div>
                  </td>
                  <td width="52" > 
                    <div align="center" class="EFONT"><a  title="E-mail:[ <%=rs("email")%> ]" href="mailto:<%=rs("email")%>">Email</a></div>
                  </td>
                  <td width="40" > 
                    <div align="center" class="EFONT" ></div>
                  </td>
                  <td valign="bottom" width="59"> 
                    <div align="right"><font color="#562CAD" class="EFONT"> 
                      <%    if rs("ip")<>""  then  %>
                      </font><font class="EFONT" color="#663300"><span class="titel">IP</span></font><font color="#663300"><span class="titel"><font class="EFONT"> 
                      :</font></span></font><font color="#000000" class="EFONT"> 
                      &nbsp; </font></div>
                  </td>
                  <td width="96" valign="bottom"> 
                    <div align="center"><font font color="#000000" class="EFONT"> 
                      <% = rs("ip")  %>
                      </font></div>
                  </td>
                  <td valign="bottom" width="72"> 
                    <div align="right"><font color="#562CAD" class="EFONT"> 
                      <% end if %>
                      </font><font class="EFONT"><font color="#FF0000" class="titel"><span class="titel">TIME 
                      :</span></font></font><span class="titel"><font color="#000000" class="EFONT">&nbsp; 
                      </font></span><font color="#000000" class="EFONT"> </font></div>
                  </td>
                  <td valign="bottom" width="442"> <div align="left"><font color="#000000" class="EFONT"> 
                      <% =rs("time") %>
                      </font></div></td>
                </tr>
              </table>
              <br>
              <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" >
                <%  
      if rs("anser")<>"" then%>
                <tr valign="middle" class="border3"> 
                  <td width="75" align="center" bgcolor="#FFFFFF" ><font color="#FF0000">斑竹回复:</font></td>
                  <td width="25" ><img 
    src="<%=rs("adminhead")%>" ></td>
                  <td bgcolor="#FFFFFF"><%=rs("anser")%></td>
                </tr>
                <%end if%>
              </table>
            </td>
          </tr>
        </table>
        <p><span >
          <%  
    i=i+1  
    if i>=MaxPerPage then exit do '循环时如果到尾部则先退出,如果记录达到页最大显示数,也退出  
       rs.movenext  
    loop  
   end sub   
  
sub showpages()  
dim n  
n=totalPage  
%>
          </span></p>
        <table border="0" width="100%" cellspacing="0" cellpadding="0"  align="center" bgcolor="#D2D2D2" class="border2" >
          <tr class="border3"> 
            <td width="60" valign="bottom" bgcolor="#FFFFFF"> 
              <div align="center"><font color="#FF0000"><span class="EFONT">Pages:</span></font></div></td>
            <td valign="bottom" bgcolor="#FFFFFF"><span class="EFONT"><font color="#FF0000" class="EFONT"> 
              <%   
   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='宋体' size='1'> >></font></A> "   
      
End If  
%>
              &nbsp;&nbsp;&nbsp;Total Pages:[<A HREF=guest.asp?Page=<%=totalPage%>><%=totalPage%></A>]</font></span></td>
        </table>
        
      </div>
      <%  
end sub  
%>
    </td>
  </tr>
</table>
</body>  
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -