📄 default.asp
字号:
<td width="186" bgcolor="#EFEFEF"><input name="oldpass" type="password" id="oldpass" maxlength="16" class="input"></td></tr>
<tr>
<td height="25" align="center" width="120" bgcolor="#EFEFEF">新密码:</td>
<td width="186" bgcolor="#EFEFEF"><input name="newpass" type="password" id="newpass" maxlength="16" class="input"></td>
</tr>
<tr>
<td height="25" align="center" width="120" bgcolor="#EFEFEF">确 认:</td>
<td width="186" bgcolor="#EFEFEF"><input name="confirm" type="password" id="confirm" maxlength="16" class="input"></td>
</tr>
<tr>
<td height="40" colspan="2" align="center" bgcolor="#EFEFEF"><input name="Submit" type="submit" id="Submit" value=" 修改 " class="button"> <input name="reSet" type="reSet" id="reSet" value=" 重置 " class="button"></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<br><br><br>
<%
case "reply"
checkadmin
If id="" then
Response.Write "<script>alert('非法操作:回复留言的ID参数不能为空!');this.location.href='default.asp';</SCRIPT>"
Response.End
End If
Set mRs=conn.execute("SELECT * FROM [book] WHERE id="&id)
If mRs.eof then
Response.Write "<script>alert('留言不存在!');this.location.href='default.asp';</SCRIPT>"
Response.End
End If
Name=mRs("Name")
Qq=mRs("Qq")
Mail=mRs("Mail")
Info=mRs("Info")
reply=mRs("reply")
%>
<table border="0" cellpadding="1" cellspacing="1" style="border-collapse: collapse" width="768" bgcolor="#CCCCCC" align="center">
<tr bgcolor="F3F3F3">
<td>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td height="25"> · 回复留言: ·</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="F3F3F3">
<td>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<form name="form1" method="post" action="<% =filename %>?action=Reply&id=<% =id %>">
<tr>
<td width="43" height="37" align="center" bgcolor="#EFEFEF">昵称:</td>
<td><input name="Name" type="text" class="input" value="<% =mRs("Name") %>"></td>
</tr>
<tr>
<td width="43" height="37" align="center" bgcolor="#EFEFEF">Q Q:</td>
<td><input name="Qq" type="text" class="input" value="<% =mRs("Qq") %>"></td>
</tr>
<tr>
<td width="43" height="37" align="center" bgcolor="#EFEFEF">邮箱:</td>
<td><input name="Mail" type="text" class="input" value="<% =mRs("Mail") %>"></td>
</tr>
<tr>
<td width="43" height="37" align="center" bgcolor="#EFEFEF">留言:</td>
<td><textarea name="Info" rows="9" cols="57" class="button"><% =mRs("Info") %></textarea></td>
</tr>
<tr>
<td height="25" align="center" bgcolor="#EFEFEF">回复:</td>
<td height="100" rowspan="2" bgcolor="#EFEFEF">
<textarea name="Reply" rows="6" cols="97" class="button"><% =Reply %></textarea></td>
</tr>
<tr>
<td height="70" bgcolor="#EFEFEF"></td>
</tr>
<tr>
<td height="20" colspan="2" align="center" bgcolor="#EFEFEF"><input name="Submit1" type="submit" id="Submit" value=" 回复留言 " class="button"> <input name="reSet" type="reSet" id="reSet4" value=" 重新输入 " class="button"></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<br><br><br>
<%
Set mRs=nothing
case Else
%>
<table border="0" cellpadding="1" cellspacing="1" style="border-collapse: collapse" width="768" bgcolor="#CCCCCC" align="center">
<tr bgcolor="F3F3F3">
<td>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td height="25"> · 写留言 ·</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="F3F3F3">
<td>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<form name="form2" method="post" action="<% =filename %>?action=add">
<tr>
<td width="100" align="center">昵称:</td>
<td width="166"><input name="Name" type="text" class="input"><font color="#FF0000"> *</font></td>
<td width="48" align="center">内容:</td>
<td rowspan="4" width="447">
<textarea name="Info" rows="9" cols="57" class="button"></textarea><font color="#FF0000"> *</font></td>
</tr>
<tr>
<td align="center">Q Q:</td>
<td><input name="Qq" type="text" class="input"><font color="#FF0000"> *</font></td>
<td></td>
</tr>
<tr>
<td align="center">邮箱:</td>
<td><input name="Mail" type="text" class="input"><font color="#FF0000"> *</font></td>
<td></td>
</tr>
<tr>
<td width="317" colspan="3" align="center">
<input type="submit" name="Submit2" value=" 添加留言 " class="button"> <input name="reSet" type="reSet" value=" 重新输入 " class="button"></td>
</tr>
<tr>
<td height="23"></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="1" cellspacing="1" style="border-collapse: collapse" width="768" bgcolor="#CCCCCC" align="center">
<tr bgcolor="F3F3F3">
<td>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td height="25"> · 留言列表 ·</td>
<td width="150"><%
If session("admin")<>"" then
Response.Write" <a href='"&filename&"?action=modpass' style='color:black'>修改帐号</a> "
Response.Write" <a href='"&filename&"?action=logout' style='color:black'>退出管理</a>"
Else
Response.Write" <a href='"&filename&"?action=login' style='color:black'>管理员登录</a>"
End If
%>
</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="F3F3F3">
<td>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<%
sql="select * from [book] order by id desc"
Set mRs=Server.CreateObject("adodb.recordSet")
mRs.open sql,conn,1,1
If mRs.bof and mRs.eof then
Response.Write"<span>没有任何记录</span>"
Response.End
Else
mRs.PageSize =8'每页记录条数
iCount=mRs.RecordCount '记录总数
iPageSize=mRs.PageSize
maxpage=mRs.PageCount
page=request("page")
If Not IsNumeric(page) or page="" then
page=1
Else
page=cint(page)
End If
If page<1 then
page=1
ElseIf page>maxpage then
page=maxpage
End If
mRs.AbsolutePage=Page
If page=maxpage then
x=iCount-(maxpage-1)*iPageSize
Else
x=iPageSize
End If
End If
%>
<%
i=1
for j=1 to mRs.pagesize
%>
<tr>
<td>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="5%" height="25" align="center"><font color="#006699" face="wingdings">2</font></td>
<td width="65%">昵称为:<b><% =mRs("Name") %></b>在<font color="#006699"><% =mRs("Time") %></font>的留言:
<%
If session("Admin")<>"" then
Response.Write" <a href='"&filename&"?action=reply&id="&mRs("id")&"' style='color:red'>回复</a>"
Response.Write" <a href='"&filename&"?action=del&id="&mRs("id")&"' style='color:red'>删除</a>"
End If
%>
</td>
<td width="30%">
<%
If mRs("Mail")<>"" then
Response.Write" <a target=""_blank"" href='mailto:"&mRs("Mail")&"'><font color=""#006699"" face=""wingdings"">+</font></a>"
End If
If mRs("Qq")<>"" then
Response.Write" <a target=_blank href=""http://wpa.qq.com/msgrd?V=1&Uin="&mRs("Qq")&"&Site=25175精简留言本&Menu=yes""><font color=""#006699"" face=""wingdings"">''</font></a>"
End If
%>
</td>
</tr>
<tr>
<td height="1" colspan="3" bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td height="32"></td>
<td colspan="2">
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr onmouseover="javascript:this.bgColor='#FFFFFF';" onmouseout="javascript:this.bgColor='#EFEFEF';">
<td style="width: 700;word-wrap: word-break; word-break: break-all;"><% =mRs("Info") %>
<%
If mRs("reply")<>"" then
Response.Write"<span style='color:#006699'><br><b>管理员回复:</b><br>"&mRs("Reply")&"</span>"
End If
%>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
i=i+1
mRs.movenext
If mRs.eof then exit for
next
%> </td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="1" cellspacing="1" style="border-collapse: collapse" width="768" bgcolor="#CCCCCC" align="center">
<tr bgcolor="F3F3F3">
<td>
<%
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
mRs.close
Set mRs=nothing
Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next
Response.Write("<table " & Table_style & ">" & vbCrLf )
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
Response.Write("<TD align=right>" & vbCrLf )
Response.Write(font_style & vbCrLf )
If page<=1 then
Response.Write ("首页 " & vbCrLf)
Response.Write ("上一页 " & vbCrLf)
Else
Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf)
End If
If page>=pagecount then
Response.Write ("下一页 " & vbCrLf)
Response.Write ("尾页 " & vbCrLf)
Else
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A> " & vbCrLf)
End If
Response.Write(" 页次:" & page & "/" & pageCount & "页" & vbCrLf)
Response.Write(" 共有" & iCount & "条留言" & vbCrLf)
Response.Write(" 转到" & "<INPUT TYEP=TEXT NAME=page class=inputb Maxlength=5 VALUE=" & page & ">" & "页" & vbCrLf & "<INPUT type=submit style=""font-size: 9pt"" value=GO class=buttonb>")
Response.Write("</TR></form>" & vbCrLf )
Response.Write("</table>" & vbCrLf )
End Sub
%>
</td>
</tr>
<% End select %>
<tr bgcolor="F3F3F3">
<td>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td align="center"><br><a href="http://www.ttyes.cn/zhao/">返回首页</a></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -