📄 netbook.asp
字号:
<td width="78%"><font>
<input type="text" name="Title" size="22" maxlength="36" style="font-size: 14px; width: 320; height: 19" class="smallInput">
</font></td>
</tr>
<tr>
<td width="22%" align="right">留言内容:</td>
<td width="78%"><font>
<textarea rows="6" name="Content" cols="45" style="font-size: 14px" class="smallInput"></textarea>
</font></td>
</tr>
<tr>
<td width="22%" align="right"></td>
<td width="78%"><input type="submit" value="提交你的留言" name="cmdOk"
>
<input type="reset" value="复位" name="cmdReset">
</td>
</tr>
</table>
</form>
<%
name=Session("UserName")
set rs=server.createobject("adodb.recordset")
sql="select * from Hover_book where name='"&name&"' or name='管理员' order by id desc"
rs.open sql,conn,1,1
dim MaxPerPageB
MaxPerPageB=10
'假如没有数据时
'If rs.eof and rs.bof then
'call showpages
'response.write "<p align='center'><font color='#ff0000'>您还没任何留言资料</font></p>"
'response.end
'End if
'取得页数,并判断留言输入的是否数字类型的数据,如不是将以第一页显示
dim text,checkpage
text="0123456789"
Rs.PageSize=MaxPerPageB
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next
If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
call showpages
call list
If Rs.recordcount > MaxPerPageB then
call showpages
end if
'显示帖子的子程序
Sub list()
%>
<table width="90%" height="19" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#D3DFEB">
<td width="20%" height="18"><strong></strong> <strong>留言列表</strong></td>
<td width="80%"><%
Response.write "<strong><font color='#000000'>-> 全部-</font>"
Response.write "共</font>" & "<font color=#FF0000>" & Cstr(Rs.RecordCount) & "</font>" & "<font color='#000000'>条留言</font></strong> "
Response.write "<strong><font color='#000000'>第</font>" & "<font color=#FF0000>" & Cstr(CurrentPage) & "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font></strong> "
If currentpage > 1 Then
response.write "<strong><a href='NetBook.asp?&page="+cstr(1)+"'><font color='#000000'>首页</font></a><font color='#ffffff'> </font></strong>"
Response.write "<strong><a href='NetBook.asp?page="+Cstr(currentpage-1)+"'><font color='#000000'>上一页</font></a><font color='#ffffff'> </font></strong>"
Else
Response.write "<strong><font color='#000000'>上一页 </font></strong>"
End if
If currentpage < Rs.PageCount Then
Response.write "<strong><a href='NetBook.asp?page="+Cstr(currentPage+1)+"'><font color='#000000'>下一页</font></a><font color='#ffffff'> </font>"
Response.write "<a href='NetBook.asp?page="+Cstr(Rs.PageCount)+"'><font color='#000000'>尾页</font></a></strong> "
Else
Response.write ""
Response.write "<strong><font color='#000000'>下一页</font></strong> "
End if
'response.write "</td><td align='right'>"
'response.write "<font color='#000000' >转到:</font><input type='text' name='page' size=4 maxlength=4 class=smallInput value="&Currentpage&"> "
'response.write "<input class=buttonface type='submit' value='Go' name='cndok'> "
%>
</td>
</tr>
<tr>
<td height="1" colspan="2" bgcolor="#999999"></td>
</tr>
</table>
<%
If rs.eof and rs.bof then
call showpages
response.write ""
response.end
End if
%>
<br>
<table width="90%" height="18" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#D7DFEA">
<tr bgcolor="#D3DFEB">
<td width="56%" height="25" align="center"
><p align="center"><font color="#000000"><b>留言主题</b></font></p></td>
<td width="22%" height="21" align="center"><font color="#000000"><b>时间</b></font></td>
<td width="22%" height="21" align="center"><font color="#000000"><b>回复</b></font></td>
</tr>
<%
if not rs.eof then
i=0
do while not rs.eof
%>
<tr bgcolor="#99CCFF">
<td height="22" bgcolor="#FFFFFF"><%if rs("name")="管理员"then%>
『网站公告』
<%end if%>
<a href="javascript:winopen('NetBookRe.asp?id=<%=rs("id")%>&name=<%=rs("name")%>')"><%=rs("title")%></a> </td>
<td height="1" bgcolor="#FFFFFF" align="center"> <%=rs("time")%></td>
<td height="1" bgcolor="#FFFFFF" align="center">
<%If rs("rebook")<>"" Then%>
<a href="javascript:winopen('NetBookRe.asp?id=<%=rs("id")%>&name=<%=rs("name")%>')">回复</a>
<%else%>
无
<%End If%>
</td>
</tr>
<%
i=i+1
if i >= MaxPerPageB then exit do
rs.movenext
loop
end if
%>
<%end sub%>
</table>
</TD>
</TR>
<TR>
<TD background=Skins/Default/CnImg/1x1_pix.gif height=1></TD>
</TR>
</TABLE></td>
</tr>
</table></td>
<td width="40" valign="top"><img src="Skins/Default/Cnimg/yytop_right.gif" width="32" height="263"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><img src="Skins/Default/Cnimg/yybottom_bottom.gif" width="570" height="85"></td>
</tr>
</table></td>
</tr>
</table></TD>
</TR>
</TABLE></td>
<td width="1" bgcolor="#CCCCCC"></td>
</tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -