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

📄 index.asp

📁 基于asp的 班级同学录主页源代码
💻 ASP
字号:
<!--#include file="../const.asp"-->
<%if session("user")="" then
response.redirect "../err.asp"
end if%>
<!--#include file="top.asp"-->
<!--#include file="bkconn.asp"-->
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class=bk>
<tr>
<td width="165" bgcolor="#FFCCCC" valign="top" align="center" class=y>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#CC99CC" align="center" class=x><font color="#FFFFFF">最 新 留
言</font></td>
</tr>
<tr>

<td height="113">&nbsp;</td>
</tr>
</table>
</td>

<td width="590" valign="top" bgcolor="#FFECEC" align="center"> <table width=95%><tr>
<td align=right><img src="../image/message.gif"><a href="guest.asp">我要留言</a></td>
</tr></table>
<%set rs1=server.createobject("adodb.recordset")
sql1="select * from book where id>0 order by id desc"
rs1.open sql1,conn,1,1
if not rs1.eof then
totalcount=rs1.recordcount
maxpage=10
page=request("page")
if page="" or page<1 then
page=1
end if
if (totalcount mod maxpage)=0 then
pagecount=totalcount\maxpage
else
pagecount=totalcount\maxpage+1
end if
if Page=1 then
rs1.movefirst
showContent
showpage totalcount,maxpage,"index.asp"
elseif (page-1)*maxpage<totalcount then
rs1.move  (page-1)*maxpage
showContent
showpage totalcount,maxpage,"index.asp"
else
page=1
showContent
showpage totalcount,maxpage,"index.asp"
end if
rs1.close
	
set rs1=nothing
conn.close
set conn=nothing
sub showContent
dim i
i=1
%>
<%do while not rs1.eof %>
<table border="1" cellpadding="2" width=95% bgcolor="#FFECEC" bordercolordark="#FFFFFF" bordercolorlight="#000000" cellspacing="0">
<tr>
<td width="65"><font color="#000000">留言昵称:</font></td>
<td width="3" class=x>&nbsp;</td>
<td width="278"><table width="100%" border="0" cellspacing="0" cellpadding="2" style="filter:glow(color=#798AB7,strength=1)"><tr><td><%=rs1("name")%></td></tr></table></td>
<td width="224">asd</td>
</tr>
<tr>
<td width="65" class=xy><font color="#000000">此言留给:</font></td>
<td width="3" class=x>&nbsp;</td>
<td width="278"><img
src="images/<%=rs1("face")%>" align="absmiddle"> <%=rs1("title")%>&nbsp;(<%=rs1("time")%>)</td>
<td width="224" align="right">&nbsp
<%If Session("user")=sysadmin Then%>
<a href="answer.asp?T=<%=rs1("title")%>&i=<%=rs1("id")%>" target="_blank">回复/删除</a>
<%end if%>
</td>
</tr>
<tr>
<td width="65"><font color="#000000">留言内容:</font></td>
<td width="3" class=x>&nbsp;</td>
<td colspan="2"><%=rs1("content")%></td>
</tr>
<%if rs1("answer")<>"" then%>
<tr>
<td width="65"><font color="#000000">版主回复:</font></td>
<td width="3" class=x>&nbsp;</td>
<td colspan="2"><%=rs1("answer")%></td>
</tr>
<%end if%>
</table>
<br>
<% i=i+1
if i>=maxpage then exit do
rs1.movenext
Loop
end sub
%>
<%
function showpage(totalcount,maxpage,filename)
dim n
if totalcount mod maxpage=0 then
n= totalcount \ maxpage
else
n= totalcount \ maxpage+1
end if
response.write "<table class= width=100%'><tr><td><form method=Post action="&filename&"?id="&request("id")&">"
response.write "<p align='center'><font color='red'></font>&nbsp;"
if Page<2 then
response.write "<font color='#000080'>首页 上一页</font>&nbsp;"
else
response.write "<a href="&filename&"?page=1>首页</a>&nbsp;"
response.write "<a href="&filename&"?page="&Page-1&">上一页</a>&nbsp;"
end if
if n-page<1 then
response.write "<font color='#000080'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?page="&(Page+1)&">"
response.write "下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
end if
response.write "<font color='#000080'>&nbsp;页次:</font><strong><font color=red>"&Page&"</font><font color='#000080'>/"&n&"</strong>页</font> "
response.write "<font color='#000080'>&nbsp;共<b>"&totalcount&"</b> 条记录<b>&nbsp"&maxpage&"</b>条记录/页</font> "
response.write " <font color='#000080'>转到:</font></td><td><input type='text' name='page' value="&page&" size='2' class=buttonface>"

response.write "</td><td valign=buttom><input type='image'  src='../image/alumni_search.gif'></td></form></tr></table>"
end function
%>
</td>
</tr></table></div>
	
<% end if%>
<!-- #include file="../End.asp" -->


⌨️ 快捷键说明

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