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

📄 guestbook.asp

📁 都乐电子书店!!! !!! !!! !1
💻 ASP
📖 第 1 页 / 共 2 页
字号:
%> 
        <p class=center align="center">〖<a href="guestbook.asp?job=fill"> 点这里写入你的留言</a>〗</p>
        <p class=center align="center">〖<a href="http://dule.gbsource.net">返回都乐</a>〗</p>
          <p class=center>共有留言 <%= RecordCount %> 条,<%= PageCount %> 页:<%
For iPage = 1 to PageCount
    If iPage=Page Then
        Response.Write "[ " & iPage & " ]"
    Else
        Response.Write "[<a href=""guestbook.asp?job=display&page=" & iPage & """>" & iPage & "</a>]"
    End If
Next
Response.Write "</p>" & vbcrlf

If Not (RecDule.BOF or RecDule.EOF) Then
    For iRecord = 1 to PageSize
        address = RTrim(RecDule("address"))
        email = RTrim(RecDule("email"))
        homepage = RTrim(RecDule("homepage"))
%>
          <table align="center" border=2 width=450 cellspacing=0 cellpadding=2 bordercolorlight="#eeccff" bordercolordark="#eeccff">
            <tr>
              <td width=50> 姓名:</td>
              <td><%= RTrim(RecDule("name")) %></td>
              <td width=50> IP:</td>
              <td><%= RTrim(RecDule("ip")) %></td>
              <td width=50> 时间:</td>
              <td><%= RTrim(RecDule("time")) %></td>
            </tr>
            <% If address<>"" Then %>
            <tr>
                <td> 地址:</td>
                <td colspan=5><%= address %></td>
            </tr>
            <% End If %>
            <% If email<>"" Then %>
            <tr>
                <td> 信箱:</td>
                <td colspan=5><a href="mailto:<%= email %>"><%= email %></a></td>
            </tr>
            <% End If %>
            <% If homepage<>"" Then %>
            <tr>
                <td> 主页:</td>
                <td colspan=5><a href="http://<%= homepage %>" target=_blank><%= homepage %></a></td>
            </tr>
            <% End If %>
            <tr>
                <td> 留言:</td>
                <td colspan=5>
                  <%= RTrim(RecDule("content")) %>
                  <%
                  RecReply.Open "SELECT * FROM gbookreply WHERE [回复]="&RecDule("id")&" ORDER BY [序号]" , ConDule , 1
                  If Not RecReply.EOF Then
                      '	以Table显示留言回复
                  %>
                  <table width="100%" align="center" border=0 cellpadding=4 bgcolor=#f0f0f0>
                    <tr><td>
                      <b>回复</b><br>
                      <hr width="90" align="center">
                  <%
                      RecReply.MoveFirst
                      While Not RecReply.EOF
                          Response.Write "<li>"
                          Response.Write RecReply("内容")
                          Response.Write "</li>"
                          RecReply.MoveNext
                      WEnd
                  %>
                    </td></tr>
                  </table>
                  <%
                  End If
                  RecReply.Close
                  %>
                </td>
            </tr>
          </table>
          <p>&nbsp;</p>
<%
        RecDule.MoveNext
        If RecDule.EOF Then Exit For
    Next
End If
RecDule.Close
'ConDule.Close

'================================================================================================
Case "search"

'ConDule.Open "dule","sa","gbs108@www"

KeyWord = Request("keyword")
sql = "SELECT * FROM gbook WHERE show=1 AND ("_
    + "name LIKE '%" & KeyWord & "%' " _
    + "OR ip LIKE '%" & KeyWord & "%' " _
    + "OR address LIKE '%" & KeyWord & "%' " _
    + "OR email LIKE '%" & KeyWord & "%' " _
    + "OR homepage LIKE '%" & KeyWord & "%' " _
	+ "OR time LIKE '%" & KeyWord & "%' " _
    + "OR content LIKE '%" & KeyWord & "%') "_
    + "ORDER BY id DESC"
RecDule.Open sql,ConDule,3

If RecDule.EOF Then
    '   找不到,显示信息
%>
          <table align="center" border=2 bordercolor="#eeccff" cellspacing=0 cellpadding=5 width=350>
            <tr>
              <td>
                <p class=center>对不起,我们没有发现你要找的内容。<br><br>
                你要查找的关键字是:[<font color=#ff0000><%= Replace(Request("KeyWord")," ",",") %></font>]<br><br>
                你可以再试试其它的查询</p>
                <form action="main.asp" method="get" id=form1 name=form1>
                  <input type="hidden" name="frame" value="guestbook">
                  <input type="hidden" name="job" value="search">
                  <p class=center><input type="text" size=18 maxlength=18 name="keyword"><input type="submit" value=" 查 " id=submit2 name=submit2></p>
                </form>
              </td>
            </tr>
          </table>
<%
Else
    PageSize = 10   '每页显示十条留言
    RecDule.PageSize = PageSize
    PageCount = RecDule.PageCount
    RecordCount = RecDule.RecordCount

    Page = CInt(Request("page"))
    If Page<1 Then
        Page=1
    ElseIf Page>PageCount Then
        Page=PageCount
    End If
    RecDule.AbsolutePage = Page
%>
          <p class=center><a href="guestbook.asp?job=fill">点这里写入你的留言</a></p>
          <p class=center>搜索到有 <%= RecordCount %> 条留言,共 <%= PageCount %> 页:<%
    For iPage = 1 to PageCount
        If iPage=Page Then
            Response.Write "[." & iPage & ".]"
        Else
            Response.Write "[<a href=""guestbook.asp?job=search&page=" & iPage & "&keyword=" & KeyWord & """>." & iPage & ".</a>]"
        End If
    Next
    Response.Write "</p>" & vbcrlf

    If Not (RecDule.BOF or RecDule.EOF) Then
        For iRecord = 1 to PageSize
            name = Trim(RecDule("name"))
            ip = Trim(RecDule("ip"))
            address = Trim(RecDule("address"))
            email = Trim(RecDule("email"))
            homepage = Trim(RecDule("homepage"))
            createtime = Trim(RecDule("time"))
            content = RecDule("content")
        
            name = Replace(name,KeyWord,"<font color=#ff0000>" & KeyWord & "</font>")
            ip = Replace(ip,KeyWord,"<font color=#ff000000>" & KeyWord & "</font>")
            address = Replace(address,KeyWord,"<font color=#ff0000>" & KeyWord & "</font>")
            email = Replace(email,KeyWord,"<font color=#ff0000>" & KeyWord & "</font>")
            homepage = Replace(homepage,KeyWord,"<font color=#ff0000>" & KeyWord & "</font>")
            createtime = Replace(createtime,KeyWord,"<font color=#ff0000>" & KeyWord & "</font>")
            Content = Replace(content,KeyWord,"<font color=#ff0000>" & KeyWord & "</font>")
 %>
          <table align="center" border=2 width=450 cellspacing=0 cellpadding=2 bordercolorlight="#eeccff" bordercolordark="#eeccff">
            <tr>
              <td width=50> 姓名:</td>
              <td><%= name %></td>
              <td width=50> IP:</td>
              <td><%= ip %></td>
              <td width=50> 时间:</td>
              <td><%= createtime %></td>
            </tr>
            <% If address<>"" Then %>
            <tr>
                <td> 地址:</td>
                <td colspan=5><%= address %></td>
            </tr>
            <% End If %>
            <% If email<>"" Then %>
            <tr>
                <td> 信箱:</td>
                <td colspan=5><a href="mailto:<%= RecDule("email")%>"><%= email %></a></td>
            </tr>
            <% End If %>
            <% If homepage<>"" Then %>
            <tr>
                <td> 主页:</td>
                <td colspan=5><a href="http://<%= RecDule("homepage")%>" target=_blank><%= homepage %></a></td>
            </tr>
            <% End If %>
            <tr>
                <td> 留言:</td>
                <td colspan=5><%= content %></td>
            </tr>
          </table>
          <p>&nbsp;</p>
<%
            RecDule.MoveNext
            If RecDule.EOF Then Exit For
        Next
    End If
End If
RecDule.Close
'ConDule.Close

'================================================================================================
End Select

'	关闭数据库
ConDule.Close

'================================================================================================
'Response.End
%>
        </td></tr>
        <tr><td></td></tr>
      </table>
    </td>
    <td></td>
<% If Session("logined") = False Then %> 
<td width=150 background="images/shortline.gif">&nbsp;</td>
<% End If %>

⌨️ 快捷键说明

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