<% i=Request("i") if i="" then call a() else Select Case i Case "1" call a() Case "2" call b() Case "3" call c() end Select end if %> <% '------------------------ 'a '------------------------ sub a() %> <% const MaxPerPage=5 '单独页最大记录数 const 用来申明常量 dim sql dim rs dim totalPut '总记录 dim CurrentPage '当前页次 dim TotalPages '总页数 dim i %> <% dim filename,id 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 %>
暂时还没有留言!
<% response.end end if %> <% if not rs.eof then rs.MoveFirst '注意放到前面来,否则到任何页总是在第一个记录上 end if rs.pagesize=MaxPerPage '设置每页最多显示多少条记录 If trim(Request("Page"))<>"" then '如果请求的页次不为空 CurrentPage= CLng(request("Page")) 'clng是转换成长整型数据类型,并赋值到当前页次上 If CurrentPage> rs.PageCount then '如果当前页次大于总页数,则将最大页次赋值到当前页次上 CurrentPage = rs.PageCount End If Else CurrentPage= 1 '一切条件不成立,将当前页设为第一页 End If totalPut=rs.recordcount '将总记录赋值于TOTALPUT if CurrentPage<>1 then '如果当前页数不等于第一页 if (currentPage-1)*MaxPerPage <% id=(totalPut-MaxPerPage*(currentPage-1))+1 i=0 Do While Not rs.EOF and i
第<%=id%>位
发表时间: <%=rs("time")%>
来自:<%=rs(" width="18" height="18">
IP:<%=rs(" width="18" height="18">
 
" width="75" height="75">
<%=rs("name")%>
<%if rs("show")=2 then response.write"此留言内容为悄悄话,只有管理员才可查看!

" End If %><%=rs("title")%>
<%=rs("content")%>
<% if rs("reply")<>"" then%>

站长回复:<%=htmlencode(rs("reply"))%>
<%end if%>

<% i=i+1 rs.movenext loop %>
当前第<%=currentpage%>页 总共<%=n%>页 共<%=rs.recordcount%>个留言 <%k=currentPage if k<>1 then response.write "["+"首页] " response.write "["+"上一页] " else Response.Write "[首页] [上一页]" end if if k<>n then response.write "["+"下一页] " response.write "["+"尾页] " else Response.Write "[下一页] [尾页]" end if %>
<% rs.close %> <% end sub %> <% '------------------------ '编辑新闻 '------------------------ sub b() %> <% Dim id id=trim(request("id")) If IsNumeric(id) = False Then GoError "请通过页面上的链接进行操作,不要试图破坏此系统。" End If sSql="delete * from book where id="&id Conn.execute sSql Response.Write "" %> <% end sub %> <% '------------------------ '编辑新闻 '------------------------ sub c() %> <% Dim id id=trim(request("id")) If IsNumeric(id) = False Then GoError "请通过页面上的链接进行操作,不要试图破坏此系统。" End If set oRs=Server.CreateObject("ADODB.Recordset") sSql="select * from book where id="&id oRs.open sSql,Conn,1,3 %> <% if request("hiddenField")=1 then dim sql,BookReply,i For i = 1 To Request.Form("reply").Count BookReply = BookReply & Request.Form("reply")(i) Next BookReply=CheckStr(BookReply) sql="Update book set reply='"&BookReply&"' Where id="&id conn.execute sql response.write "

留言回复成功!

" Response.End end if %> " method="post" name="form" id="form" onsubmit=return(CheckInput())>
管 理 员 回 复
回复 [ <%=oRs("name")%> ] 的留言

回复内容:

   
<% oRs.Close %> <% end sub %>