/ly.asp代码页
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><?xml version="1.0" encoding="utf-8"?>
<%response.buffer=true%>
<%Response.ContentType = "text/vnd.wap.wml; charset=utf-8"%>

<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> 
<!--#include file="conn.inc"-->


<wml><%
'====================================================================
' 请你保留这段说明,这并不会影响你的速度.   电脑交流:http://www.cnscu.cn
' 程序制作:横云			  掌上校园收倾心整理收集于互联网,感谢你的支持!
' 升级时间: 2008-2-5  		主页地址:HTTP://wap.cnscu.cn
' E-Mail: cnscu@126.com   	客服QQ:554904632 QQ群:30493504 QQ群2:46659883
'====================================================================
%> <head>
<meta http-equiv="Cache-Control" content="no-Cache"/>
<meta http-equiv="Cache-Control" content="max-age=0"/>
</head>
<%
page=cint(request.QueryString("page"))
if page="" or page<1 then page=1

Function c2u(sGBStr)
Dim i,c
if sGBStr<>"" then 
For i = 1 to Len(sGBStr)
c = Mid(sGBStr,i,1)
if c=chr(13) then 
c2u = c2u & "<br/>"
else
c2u = c2u & "&#x" & Hex(AscW(c)) & ";"
end if
Next
end if
End Function
function ubb(str)
	str=trim(str)
	if IsNull(str) then exit function
	str=replace(str,"&","&amp;")
	str=replace(str,"<","&lt;")
	str=replace(str,">","&gt;")
	str=replace(str,"$","$$")
	str=replace(str,"","&nbsp;")
        str=replace(str,Chr(13),"<br/>")
	ubb=str
end function
%>
<card title="站长信箱">
<p>
<%
set rs=Server.CreateObject("ADODB.Recordset")
rsstr="select * from [gbook] order by [ID] desc"
rs.open rsstr,conn,1,2

maxpage=int((rs.recordcount-1)/10)+1
if page>maxpage then page=maxpage

if rs.recordcount = 0 then response.write("暂无留言!<br/><br/>")
if rs.recordcount > 0 then


rs.Move((page-1)*10)
dim j,pic
j=1
pic=rs("pic")

response.write("共" & rs.recordcount & "条<br/>")
if page*10<rs.recordcount or page>1 then response.write("<br/>")
do while ((not rs.EOF) and j<=10)
%>
<!--%=ubb(rs("title"))%-->
<%    
biaoti=left(rs("title"),8)
if len(rs("title"))>8 then
biaoti=biaoti+".."
end if
%>
<%=((page-1)*10+j)%>.
<% if rs("open") then %>*<% end if%>
<a href='lyview.asp?lhc=<%=lhc%>&amp;ID=<%=rs("ID")%>&amp;page=<%=page%>'><%=ubb(biaoti)%></a>
<% if rs("retext")<>"" then %>[复]<% end if%>
<% if rs("retext")="" then %>[待]<% end if%>
<br/>
<%
rs.MoveNext
j=j+1
loop
end if

if page*10<rs.recordcount then response.write("<a href='?lhc=" & lhc & "&amp;page=" & page+1 & "'>下一页</a>")
if page>1 then response.write("|<a href='?lhc=" & lhc & "&amp;page=" & page-1 & "'>上一页</a>")
if page*10<rs.recordcount or page>1 then response.write("<br/>")
response.write("(第"& page & "/" & (int((rs.recordcount-1)/10)+1) &"页)<br/>")
%>

<%if page*10<rs.recordcount or page>1 then%>
跳到第<input name="gpage<%=minute(now)%><%=second(now)%>" title="页码" type="text" format="*N" emptyok="true" size="3" value="<%response.write(page+1)%>" maxlength="3"/>页
<anchor>[GO]
    <go href="ly.asp?lhc=<%=lhc%>" accept-charset='utf-8'>
        <postfield name="page" value="$(gpage<%=minute(now)%><%=second(now)%>)"/>
    </go>
</anchor><br/>
<%end if%>
<a href="lyadd.asp">我有话说</a>|<a href="index.asp">网站首页</a>
</p>
</card>
</wml>
<%
conn.close
set conn=nothing
%>
字母检索
回到顶部