Index.Asp
上传用户:qfkgdy
上传日期:2020-06-18
资源大小:1888k
文件大小:2k
- <!--#include file="../wml.ini"-->
- <%
- Page=request.QueryString("Page")
- if Page="" or Page<1 then Page=1
- call wmlbegin("留言本","wrap")
- '-------------------------------------------------------------------------------------
- set rs=Server.CreateObject("ADODB.Recordset")
- rsstr="select * from [Message] order by [id] desc"
- rs.open rsstr,conn,1,2
- call wmllink("Add_Message.Asp","发表留言",true)
- WMLCompart()
- if rs.eof then
- call wmlwrite("暂无留言",true)
- else
- maxpage=int((rs.recordcount-1)/10)+1
- if Page>maxpage then Page=maxpage
- if rs.recordcount > 0 then
- rs.Move((Page-1)*10)
- dim j
- j=1
- do while ((not rs.EOF) and j<=clng(10))
- Set Rsa = Server.CreateObject("Adodb.Recordset")
- Sqll = "SELECT * FROM Message order by id asc"
- Rsa.Open Sqll,conn,1,1
- %>
- <%=((page-1)*10+j)%>.<a href='View.asp?id=<%=rs("id")%>'><%=outHTM(rs("Title"))%></a>(作者:<%=outHTM(rs("Name"))%>)
- <%
- if rs("Whether")="1" then
- call wmlwrite("[已复]",true)
- else
- call wmlwrite("",true)
- end if
- rs.MoveNext
- j=j+1
- loop
- end if
- end if
- if Page*10<rs.recordcount then response.write("<a href='Index.Asp?Page=" & Page+1 & "'>下页</a> ")
- if Page>1 then response.write("<a href='Index.Asp?Page=" & Page-1 & "'>上页</a> ")
- if Page*10<rs.recordcount or Page>1 then response.write("(" & Page & "/" & (int((rs.recordcount-1)/10)+1) & ")<br/>")
- %>
- <% if Page*10<rs.recordcount or Page>1 then %>
- <input name="page" title="页码" type="text" format="*N" emptyok="true" size="3" maxlength="4" value="<%if Page>=maxpage then response.write(Page-1) else response.write(Page+1)%>"/>
- <anchor>跳页
- <go href="Index.Asp" accept-charset='utf-8'>
- <postfield name="Page" value="$(page)"/>
- </go>
- </anchor><br/>
- <% end if %>
- <%
- call wmlwrite("" & rs.recordcount & "条留言",true)
- rs.close
- set rs=nothing
- conn.close
- set conn=nothing
- call wap.navs("留言本,")
- call wmlend
- %>