网页留言板的代码

2024-12-17 06:37:45
推荐回答(1个)
回答1:


<%@ Language=VBScript %>

<%
dim ASPBook
dim StrSQL

if not isempty(request("page")) then
Mypage=cint(Request("page"))
else
Mypage=1
end if

set ASPBook = Server.CreateObject("ADODB.Recordset")

StrSQL = "Select * from guest order by ID desc"
ASPBook.open StrSQL,conn,1,1

ASPBook.pagesize=Mypagesize
maxpages=cint(ASPBook.pagecount)
totalsize=cint(Mypagesize)
ASPBook.absolutepage=Mypage
GuestTotal=ASPBook.RecordCount

if cint(Mypage) >1 then
if cint(Mypage) > maxpages then
MESSAGE("

  • 没有你所想去的页数!
  • ")
    Response.End
    end if
    end if
    HEADER "显示留言"
    MyMenu
    %>



    [ 客户留言系统 ]









    签写留言


    Total of
    <%=GuestTotal%> messages,

    <%=MyPageSize%>
    messages per page, You are on page
    <%=cint(Mypage)%>
    <%=Greeting%>... <%PageLink%>










    签写留言



















    留言者 :




    留言内容 :




    <%
    If ASPBook.Eof or ASPBook.Bof then
    Response.Write ""
    Response.Write ""
    else

    i = 0
    total = 0

    do until ASPBook.Eof or total = totalsize

    if i = 0 then

    CColor = Color1

    else
    CColor = Color2

    end if

    %>



    <%
    ASPBook.MoveNext
    i = i + 1
    if i = 2 then i = 0
    total = total + 1
    loop
    %> <%END IF%>
    对不起,目前还没有任何留言,如要留言,请按“我要留言”图片!















    <%if ASPBook("Reply")<>"" then%>
    <%end if%>











    <%=ASPBook("名字")%>
    <%if ASPBook("性别") = "boy" then%>


    英俊潇洒的 <%=ASPBook( 先生" align="middle" border="0">
    <%elseif ASPBook("性别") = "girl" then%>
    美丽又温柔的 <%=ASPBook( 小姐" align="middle" border="0">


    <%end if%>
    Form: <%=ASPBook("来自")%>



    .gif" border="0" align="ABSCENTER">
    On:
    <%=ASPBook("留言日期")%>

    <%if ASPBook("邮件")<>"" then%>
    ">

    <%end if%> <%if ASPBook("主页")<>"" and ASPBook("主页")<>"http://" then%>
    " Target="_blank">

    <%end if%> <%if ASPBook("ICQ")<>"" then%>
    ICQ:<%=ASPBook(" align="absmiddle" border="0" width="15" height="16">
    <%if ASPBook("OICQ")<>"" then%> <%end if%>
    " target="_blank">
    OICQ:<%=ASPBook(" align="absmiddle" border="0" width="16" height="16">

    <%end if%>
    <%=ASPBook(" align="absmiddle" border="0" width="13" height="16">
    <%=ASPBook(" align="absmiddle" border="0" width="15" height="16">
    <%=ASPBook("留言")%>

    Reply :
    (<%=ASPBook("Reply_Date")%>)

    .gif" border="0" align="ABSCENTER"><%=ASPBook("Reply")%>


















    ">
    回复该留言

    ">
    删除该留言


    <%COPYRIGHT%>







    <%PageLink%>









    <%

    function PageLink

    PageShowSize = 10
    Scriptname=Request.Servervariables("script_name")
    PageNextSize=int((MyPage-1)/PageShowSize)+1
    Pagetpage=int((GuestTotal-1)/MyPageSize)+1

    if Maxpages > 1 then
    if PageNextSize >1 then
    PagePrev=PageShowSize*(PageNextSize-1)
    Response.write "[<<]-"
    end if
    if Mypage-1 > 0 then
    Prev_Page = MyPage - 1
    Response.write "[<] "
    end if
    if maxpages>=PageNextSize*PageShowSize then
    PageSizeShow = PageShowSize
    else
    PageSizeShow = Maxpages-PageShowSize*(PageNextSize-1)
    end if
    for PageCounterSize=1 to PageSizeShow
    PageLink = (PageCounterSize+PageNextSize*10)-10
    if PageLink <> cint(Mypage) then
    Response.write "[" & PageLink & "] "
    else
    Response.Write PageLink & " "
    end if
    next
    if Mypage+1 <=Pagetpage then
    Next_Page = MyPage + 1
    Response.write "[>]"
    end if
    if maxpages > PageShowSize*PageNextSize then
    PageNext = PageShowSize * PageNextSize + 1
    Response.write "-[>>]"
    end if
    else
    Response.write "[1]"
    end if
    END function

    set ASPBook=nothing
    conn.Close
    set conn = nothing
    %>