⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 indexw.asp

📁 功能完备的留言板 公告管理 用户管理 留言管理 分页 功能的实现 Access数据库
💻 ASP
字号:
<html>
<head> 
<title>计算机系留言薄</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel=stylesheet type=text/css></head>

<body topmargin="8" bgcolor="#FFFFFF">

	<div align="center">

	<table border="0" width="86%" id="table3" height="124" cellspacing="0" cellpadding="0">
		<tr>
			<td height="69">
			<p>
			<img border="0" src="images/top.gif" width="100%" height="100%"></td>
		</tr>
		<tr>
			<td height="8"> </td>
		</tr>
		<tr>
			<td height="12">
			<table border="1" width="100%" id="table4" cellspacing="0" cellpadding="0" height="22" bgcolor="#F4F4FF" bordercolor="#F7F7FF" bordercolorlight="#000000" bordercolordark="#FFFFFF" style="margin-top: 0; margin-bottom: 6">
				<tr>
			<td height="20" width="17%" align="center" style="font-size: 12px"><a href="add.asp">
			签写留言</a></td>
			<td height="20" width="67%" align="center" style="font-size: 12px" >
			<marquee scrolldelay="150" width="378" height="13" >zzzz</marquee></td>
			<td height="20" width="16%" align="center" style="font-size: 12px"><a href="login.asp">
			管理入口</a></td>
				</tr>
			</table>
			</td>
		</tr>
		</table>
	</div>



<%
	Set conn = Server.CreateObject("ADODB.Connection")
	conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("book.asp")
	
	set rs=server.createobject("adodb.recordset")
	sql="select * from [guest] "
	rs.open sql,conn,1,1

	PageSize = 10
	rs.PageSize = PageSize
	TotalPages=rs.PageCount
	TotalRecords=rs.RecordCount

	if TotalRecords<1 then
		Response.write "错误,记录集为空"
		Response.end
	end if
	
	
	'得到用户选择并检查currentpage是否越界
	if not isempty(request("page")) then
		currentPage=cint(request("page"))
	else
		currentPage=1
	end if
	
	if currentpage<1 then
		currentpage=1
	end if
	
	if currentpage>TotalPages then
		currentpage=TotalPages
	end if
	
	rs.AbsolutePage = currentpage
%>


<%
	'循环输出当前页的内容
	do while not rs.eof and i<PageSize
%>
		<hr noshade width="650" color="#000000" size="1">
		<div align="center">
		<table width="650"  bgcolor="#FFFFFF" border="1" cellspacing="1" cellpadding="0"  bordercolor="#000000" bordercolorlight="#000000" bordercolordark="#FFFFFF">
	 		<tr> 
	   			<td bgcolor="#FFFFFF" valign="top" rowspan="3" width="110"> 
	     			<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%" id="table5">
	       				<tr> 
	         				<td width="12" height="100%" bgcolor="#FFFFFF"> </td>
	         				<td height="100%" valign="top" bgcolor="#FFFFFF"><br>
								姓名:<%=rs("guestname")%> <br>
			 					<img src="images/<%=rs("face")%>"> <br><br>
	           					來自:<%=rs("from")%> 
	         				</td>
	       				</tr>
	     			</table>
	   			</td>
	   			<td valign="top" height="22"> 
	     			<table width="100%" border="0" cellspacing="0" cellpadding="0">
	       				<tr> 
	         				<td width="10" height="20">         
							<td height="20" width="418"> 
           						<a href="mailto:<%=rs("email")%>"> 
           						<img src="images/EMAIL.GIF" width="45" height="18" border="0" alt="Email:<%=rs("email")%>"></a>&nbsp; 
           	
           						<a href="<%=rs("homepage")%>"> 
           						<img src="images/homepage.gif" width="47" height="18" border="0" alt="http://<%=rs("homepage")%>"></a>&nbsp;&nbsp; 
           	
           						<a href=<% = rs("oicq")%>"> 
           						<img src="images/OICQ.gif" width="50" height="16" border="0" alt="QQ:<%=rs("oicq")%>"></a>&nbsp; 
           	
           						<a href="edit.asp?time=<% =rs("guestdate")%>">
           						<img src="images/EDIT.GIF" width="47" height="18" border="0" alt="签写于:<% =rs("guestdate")%>"></a> 
           
								<img border="0" src="images/ip.gif" width="47" height="18"  alt="IP:<% =rs("ip")%>">
							</td>
							<td height="20" align="center"> 
           						&nbsp;&nbsp;&nbsp;&nbsp;NO.<%=(rs.AbsolutePage-1)*PageSize+i+1%>
           					</td>
	       				</tr>
	     			</table>
	   			</td>
	 		</tr>
	 		<tr> 
	   			<td valign="top" height="69"> 
	     			<table width="100%" border="0" cellspacing="0" cellpadding="0" height="64">
	       				<tr> 
	         				<td width="11" bgcolor="#F4F4FF"> </td>
	         				<td width="583" bgcolor="#F4F4FF"><br>
	         					<%=rs("guestcontent")%>       <br><br>
	           					<font color="#000080">回复:</font><font color="#00A800">
	           					<font color="#7c7cd3"><%=rs("guestreply")%> </font><br>
	         				</td>
       					</tr>
	     			</table>
	   			</td>
	 		</tr>
	 		<tr> 
	   			<td height="24">&nbsp;&nbsp;发表于:<%=rs("guestdate")%>&nbsp;</td>
	 		</tr>
		</table>
		</div>
<%		
		i=i+1
		rs.movenext
	loop 
%>

<div align="center">

<%	
	'输出页面跳转超链接/表单
	
	response.write "<form method=post action=indexw.asp>"
	response.write " "
	
	if Session("Page")=1 then
		response.write "<font color='#0000ff'>首頁&nbsp;上一頁&nbsp;</font> "
	else
		response.write "<a href=indexw.asp?page=1>首頁&nbsp;</a>"
		response.write "<a href=indexw.asp?page=" & currentpage-1 & ">上一頁&nbsp;</a>"
	end if
	
	if Session("Page")=TotalPages then
		response.write "<font color='#0000ff'>下一頁&nbsp;尾頁&nbsp;</font>"
	else
		response.write "<a href=indexw.asp?page=" & currentpage+1 & ">下一頁&nbsp;</a> "
		response.write "<a href=indexw.asp?page=" & TotalPages & ">尾頁&nbsp;</a>"
	end if
	
	response.write "<font color='#000080'> 共<b>" & TotalRecords & "</b>条留言   每頁<b>" & PageSize & "</b>条留言&nbsp;&nbsp;</font>"
	response.write "<font color='#000080'>转到:</font><input class=smallInput type='text' name='page' size=4 maxlength=10 value=" & Page & ">"
	response.write "<input class=buttonface type='submit' value='Go' name='cndok'></form>"
%><% 
	rs.close 
	Set rs = Nothing
	conn.close 
	set conn=nothing 
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -