<% Language="VBScript" response.buffer=true Response.Expires=0 if session("pas")<>"pas" then response.redirect "ad_login.asp" end if %> 上海网站建设,公司企业网站建设,企业上网咨询
 
 

 

 

<% Language="VBScript" dim conn dim connstr dim totalPut dim CurrentPage dim TotalPages dim i,j dim sql dim rs on error resume next '打开数据库 set conn=Server.CreateObject("ADODB.Connection") dbpath=Server.MapPath("lydata/guest.mdb") conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&dbpath set rs=Server.CreateObject("ADODB.Recordset") '定义每页文章显示数 const MaxPerPage=18 if not isempty(request("page")) then currentPage=cint(request("page")) else currentPage=1 end if sql="select * from ly order by id desc" Set rs= Server.CreateObject("ADODB.Recordset") rs.open sql,conn,1,1 liuyan=replace(rs("liuyan"),chr(10)+chr(13),"
") if rs.eof and rs.bof then response.write "

还没有任何留言

" else totalPut=rs.recordcount '数据库中留言数totalput if currentpage<1 then currentpage=1 end if '统计总页数currentpage if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then showpage totalput,MaxPerPage,"adviewguest.ASP" showContent showpage totalput,MaxPerPage,"adviewguest.ASP" else if (currentPage-1)*MaxPerPage
姓名: <%=rs("cname")%> 公司 <%=rs("company")%>
地址: <%=rs("adress")%> Email: <%=rs("mail")%>
">删除 电话: <%=rs("tel")%> 传真: <%=rs("fax")%> 留言时间: <%=rs("ctime")%>
留言内容: <%=rs("liuyan")%>

<% '当显示记录大于maxperpage时结束这页 i=i+1 if i>=MaxPerPage then exit do rs.movenext loop end sub function showpage(totalnumber,maxperpage,filename) '求出当每页18条记录时总共的页数 dim n if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if response.write "
" response.write "

>>分页 " '显示页数链接的条件 if CurrentPage<2 then response.write "首页 上一页 " else response.write "首页 " response.write "上一页 " end if if n-currentpage<1 then response.write "下一页 尾页" else response.write "下一页 尾页" end if response.write " 页次:"&CurrentPage&"/"&n&"" response.write ""&totalnumber&"笔记录 "&maxperpage&"笔记录/页" response.write "转到:" response.write "

" end function %>