📄 index.asp
字号:
<html>
<head>
<title>留言板</title>
<META content="MSHTML 5.50.4134.100" name=GENERATOR></HEAD>
<Script language="VBScript">
Sub datacheck()
dim username
username=trim(logto.username.value)
If username = Empty Then
MsgBox "「用户名」不得为空白!", 64, "Oh no!"
logto.username.focus
Exit Sub
End if
If logto.psw.value = Empty Then
MsgBox "「密码」不得为空白!", 64, "Oh no!"
logto.psw.focus
Exit Sub
End if
logto.submit
end sub
</script>
<script language="Javascript">
<!--
var doPopUpX = (screen.width/2)-200;
var doPopUpY = (screen.height/2)-200;
var pos = "left="+doPopUpX+",top="+doPopUpY;
function doPopUp(url){
doPopUpWindow = window.open(url,"用户信息","width=400,height=300,"+pos);
}
-->
</script>
<BODY vLink=#333333 aLink=#333333 link=#333333 bgColor=#ffffff leftMargin=0
topMargin=0><LINK href="forum.css" type=text/css
rel=stylesheet>
<TABLE cellSpacing=0 cellPadding=1 width="95%" align=center bgColor=#777777
border=0>
<TBODY>
<TR>
<TD>
<TABLE style="COLOR: #000000" cellSpacing=0 cellPadding=4 width="100%"
border=0 bgcolor="#a9d46d">
<TBODY>
<tr>
<td width="27%" height="2"><font color="#FF0000">>></font>欢迎您,<b><%if session("loginname")="" then %>请先登录!<%end if%><%=session("loginname")%></b></td>
<td width="62%" height="2"><img src="images/reg.gif" width="16" height="16" align="absmiddle"><a href="reg.asp">用户注册</a>|<img src="images/login.gif" width="16" height="16"><a href="login.asp">用户登录</a>|<img src="images/update.gif" width="16" height="16"><a href="usermodify.asp">修改资料</a>|<img src="images/message.gif" width="21" height="14">现在时间:<%=now()%></td>
<td width="11%" height="2">
<div align="right"><img src="images/home.gif" width="14" height="14" align="absmiddle">返回首页</div>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<!--#include file="inbody.asp"-->
<%if session("loginname")="" then%>
<table width="95%" border="0" align="center" bgcolor="#777777" cellpadding="1" cellspacing="1">
<tr>
<td bgcolor="#a9d46d"><b>-=>快速登录</b></td>
</tr>
<tr bgcolor="#f4faed">
<form name="logto" method="post" action="login2.asp">
<td height="32"><img src="images/login.gif" width="16" height="16">用户名:
<input type="text" name="username" size="20" maxlength="20">
<img src="images/icon_aim.gif" width="15" height="15">密码:
<input type="password" name="psw" size="20" maxlength="20">
<input type="button" value="登录" onclick="datacheck">
</td>
</form>
</tr>
</table>
<%end if%>
<table width="95%" border="0" align="center">
<tr>
<td bgcolor="#ffffff"><a href="postnew.asp"><img src="images/post.gif" width="99" height="25" border="0" alt="发表新观点!"></a></td>
</tr>
</table>
<!--#include file="db.inc"-->
<%
set rs=server.createobject("ADODB.recordset")
sql = "Select * From list Order By posttime DESC" '按ID的倒序排列
Rs.Open sql,conn,1,1
Rs.Pagesize =20 '设置每页示记录数
%>
<table width="95%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#777777">
<tr bgcolor="#a9d46d">
<td width="5%">
<div align="center"><b>状态</b></div>
</td>
<td width="39%" bgcolor="#a9d46d">
<div align="center"><b>主题</b></div>
</td>
<td width="16%">
<div align="center"><b>作者</b></div>
</td>
<td width="11%">
<div align="center"><b>回复/人气</b></div>
</td>
<td width="29%">
<div align="center"><b>最后发表时间|回复人</b></div>
</td></tr>
<%
Pageno = CLng(Request("page")) '取得用page信息,并处理
If Pageno < 1 Then Pageno = 1
If Pageno > Rs.PageCount Then Pageno = Rs.PageCount
If pageNo = "" Then Pageno = 1
%>
<%
Sub Showpage(Rs,pageno) '接受参数,显示记录
Rs.AbsolutePage = Pageno
for I =1 To Rs.PageSize
%>
<tr>
<td bgcolor="#e3f1d1" width="5%">
<div align="center"><%if rs("answcnt")=0 then %>
<img src="images/noan.gif" width="15" height="17"><%else%>
<img src="images/havean.gif" width="15" height="17"><%end if%></div></td>
<td bgcolor="#f4faed" width="39%"><img src="images/<%=rs("faceid")%>.gif"><a href="show.asp?titleid=<%=rs("articleid")%>" target="_blank">
<%if len(trim(rs("title")))>20 then%>
<%=left(rs("title"),20)%>...
<%else%>
<%=rs("title")%>
<%end if%>
</a></td>
<td bgcolor="#e3f1d1" width="16%"><div align="center">
<a href=javascript:doPopUp("userinfo.asp?name=<%=rs("author")%>")><%=rs("author")%></a>
</div></td>
<td bgcolor="#f4faed" width="11%"><div align="center"><%=rs("answcnt")%>/<%=rs("lookcnt")%></div></td>
<td bgcolor="#e3f1d1" width="29%"><%=rs("posttime")%>|<%if rs("lastpeop")><"---" then%><a href=javascript:doPopUp("userinfo.asp?name=<%=rs("lastpeop")%>")><%=rs("lastpeop")%></a><%else%><%=rs("lastpeop")%><%end if%></td>
</tr>
<%
Rs.Movenext
If Rs.Eof Then Exit For
Next
end sub
%>
<% showpage rs,pageno %>
</table>
<!--显示分页链接-->
<table width="50%" align=center border=0 cellpadding=0 cellspacing=0><tr>
<td>
<%
If Pageno <>1 Then
Response.Write " <A href=index.asp>第一页</A> "
Response.Write " <A href=index.asp?page=" & (Pageno-1) & ">上一页</A> "
Else
Response.Write " 第一页 "
Response.Write " 上一页 "
End If
If Pageno <> rs.PageCount Then
Response.Write " <A href=index.asp?page=" & (Pageno+1) & ">下一页</A> "
Response.Write " <A href=index.asp?page=" & (Rs.PageCount) & ">最后一页</A> "
Else
Response.Write " 下一页 "
Response.Write " 最后一页 "
End If
%></td><form method="get" name="select" action="index.asp">
<td>
<select name="page">
<%
For I = 1 To Rs.PageCount
Response.Write "<option>" & I & "</option>"
Next
%>
</select>页
<input type="submit" Value="GO">
</td></form><td> 位置<%=pageno%>/<%=rs.pagecount%></td></tr></table>
<!--#include file="footer.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -