📄 index.asp
字号:
<!--#include file="../inc/conn.asp"-->
<%
dim username
username=request.querystring("username")
set rsuser=conn.execute("select * from [gbuser] where username='"&username&"' and state=1")
if rsuser.bof then
response.write "<script language=javascript>alert( ""没有这个用户,或者此用户留言本已经关闭!"");;location.href='javascript:history.back()'</script>"
response.end
end if
%>
<HTML><HEAD><TITLE><%=username%>的留言本</TITLE>
<META http-equiv=content-type content="text/html; charset=gb2312"><LINK
href="images/style.css" type=text/css rel=stylesheet>
</HEAD>
<BODY leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width=54><IMG src="images/topleft.gif"></A></TD>
<TD width=296><IMG
src="images/logo.gif" border=0></TD>
<TD background=images/topright.gif> <%=rsuser("uphtml")%></TD>
</TR></TBODY></TABLE>
<TABLE width="99%" border=0 align="center" cellPadding=6 cellSpacing=0>
<TBODY>
<TR>
<TD><%=username%>的留言本</TD>
</TR></TBODY></TABLE>
<%
sql="select * from gbook where username='"&username&"' order by id desc"
rs.open sql,conn,1,1
If rs.bof then
response.Write "<table border=0 height=60 align=center><tr><td align=center>当前还没有留言,<a href=post.asp?username="&request("username")&">按此给我留言!</a></td></tr></table>"
else
if not isempty(request("page")) then
pagecount=cint(request("page"))
else
pagecount=1
end if
rs.pagesize=10
rs.AbsolutePage=pagecount
%>
<TABLE cellSpacing=1 cellPadding=4 width="99%" align=center bgColor=#41b1e3
border=0>
<TR height=24>
<TD align=middle width="4%" background=images/tablehead.gif>表情</TD>
<TD align=middle width="50%" background=images/tablehead.gif>主题</TD>
<TD align=middle width="10%"
background=images/tablehead.gif>留言人</TD>
<TD align=middle width="5%" background=images/tablehead.gif>人气</TD>
<TD align=middle width="5%" background=images/tablehead.gif>长度</TD>
<TD align=middle width="20%"
background=images/tablehead.gif>留言时间</TD></TR>
<%do while not rs.eof%>
<TBODY>
<TR align=middle bgColor=#ffffff>
<TD><img src="images/icon<%=rs("face")%>.gif" width="19" height="19" border="0"></TD>
<TD align=left><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="90%"><a href="read.asp?user=<%=rs("username")%>&id=<%=rs("id")%>"><%=rs("title")%></a></td>
<td width="10%" align="center"><%if Request.Cookies("username")=username then
Response.Write("<a href='del.asp?user="&username&"&id="&rs("id")&"' onClick=""return confirm('确定要删除此条留言吗?');""><img src=../images/delete.gif border=0></a>")
end if%></td>
</tr>
</table></TD>
<TD align=left><%=rs("name")%></TD>
<TD align=middle><%=rs("hits")%></TD>
<TD align=middle><%=len(rs("content"))%></TD>
<TD align=middle><%=rs("posttime")%></TD></TR>
</TBODY><%rs.movenext
loop%></TABLE>
<table width="99%" border="0" cellspacing="0" cellpadding="4" align="center">
<form action="?page=<%=request.form("gopage")%>&username=<%=request("username")%>" method="post">
<tr align="center" valign="bottom" bgcolor="#ffffff">
<td> 共 <b><%=rs.recordcount%></b> 条留言 页次: <b><font color=red><%=pagecount%></font>/<%=rs.pagecount%></b>, 当前从第
<%
if pagecount<=1 then
response.write "<font color=red>1</font>"
else
response.write "<font color=red>" & pagecount*rs.pagesize-rs.pagesize+1 & "</font>"
end if
%>
条开始。
<% if pagecount=1 and rs.pagecount<>pagecount and rs.pagecount<>0 then%>
<a href="?page=<%=cstr(pagecount+1)%>&username=<%=request("username")%>">下一页</a>
<% end if %>
<% if rs.pagecount>1 and rs.pagecount=pagecount then %>
<a href="?page=<%=cstr(pagecount-1)%>&username=<%=request("username")%>"> 上一页</a>
<%end if%>
<% if pagecount<>1 and rs.pagecount<>pagecount then%>
<a href="?page=<%=cstr(pagecount-1)%>&username=<%=request("username")%>"> 上一页</a> <a href="?page=<%=cstr(pagecount+1)%>&username=<%=request("username")%>"> 下一页</a>
<% end if%>
直接到第
<select name="gopage">
<%for i=1 to rs.pagecount%>
<option value="<%=i%>"><%=i%></option>
<%next%>
</select>
页
<input name="go" type="submit" class="button" value="Go">
</td>
</tr></form>
</table>
<%
end if
%>
<TABLE cellSpacing=1 cellPadding=4 width="99%" align=center border=0>
<TBODY>
<TR height=5>
<TD colSpan=2></TD></TR>
<TR height=43>
<TD background=images/tabletail.gif height=43> </TD>
<TD align=right background=images/tabletail.gif><a href="post.asp?username=<%=request("username")%>"><IMG
src="images/buttonpost.gif" border=0></A> </TD>
</TR></TBODY>
<TABLE>
<TBODY></TBODY></TABLE>
<SCRIPT language=JavaScript>
<!--
function check(myform)
{
if (myform.key.value == "") {
alert("搜索关键词不能为空");
return false;
} else {
return true
}
}
//-->
</SCRIPT>
<TBODY></TBODY></TABLE>
<TABLE cellSpacing=1 cellPadding=4 width="99%" align=center border=0>
<TBODY>
<TR>
<TD align=center><%=rsuser("downhtml")%></TD>
</TR></TBODY></TABLE>
<TABLE>
<TBODY></TBODY></TABLE></BODY></HTML>
<%
rs.close
set rs=nothing
rsuser.close
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -