📄 guestbook.asp
字号:
</table></td>
</tr>
<tr>
<td height="268" align="center" valign="top">
<form method="post" action="?action=saveadd&id=<%=request("id")%>" name="form1">
<div align="center">
<center>
<table border="0" width="77%" cellspacing="1" cellpadding="0">
<tr>
<td width="100%"> <table border="0" width="100%" cellspacing="1" cellpadding="0" class="black">
<tr>
<td width="20%" valign="middle"> 回复内容:</td>
<td width="80%" valign="top"> <textarea rows="8" name="body" cols="50" class="input2"></textarea>
</td>
</tr>
<tr>
<td width="100%" valign="middle" height="50" colspan="2">
<div align="center">
<input type="submit" value="回复" name="B1">
</div></td>
</tr>
</table></td>
</tr>
</table>
</center>
</div>
</form></td>
</tr>
</table></div>
<%end sub
sub list1
%><form method="post" action="?action=del" name="form1">
<div align="center">
<center>
留言删除 <br>
<br>
<table border="0" width="90%" cellspacing="1" cellpadding="0" class="black">
<tr bgcolor="#AABFEC" align="center">
<td width="13%" height="28"> </td>
<td width="18%" >发布人</td>
<td width="46%" >留言主题</td>
<td width="23%" >发布时间</td>
</tr>
<%
dim curpage
if request.querystring("curpage")="" then
curpage=1
else
curpage=request.querystring("curpage")
end if
const numperpage=15
set rs=server.createobject("adodb.recordset")
sql="select * from gbook order by book_date desc "
rs.open sql,conn,1,1
if rs.eof then
response.write "<table><tr><td><br></br><center>现在还没有记录!</center><br></br></td></tr></table>"
response.end
end if
if not rs.eof then
rs.pagesize=numperpage
dim totalpages
totalpages=rs.pagecount
rs.absolutepage=curpage
end if
dim count
count=0
do while not rs.eof and count<numperpage
%>
<tr bgcolor="#DEF0FA" align="center">
<td width="13%" height="28">
<input type="checkbox" name="id" value="<%=rs("id")%>" class="mul">
</td>
<td width="18%"><%=rs("book_name")%></td>
<td width="400" style="TABLE-LAYOUT: fixed;word-wrap:break-word;"><%=rs("book_meno")%> </td>
<td width="23%"><%=rs("book_date")%> </td>
</tr>
<%
rs.movenext
count=count+1
loop
rs.close
set rs=nothing
%>
<tr bgcolor="#DEF0FA">
<td width="100%" colspan="4"> <input type="checkbox" name="chkall" value="on" onClick="CheckAll()" class="mul">
选取以上全部记录</td>
</tr>
<tr valign="middle" align="center">
<td width="100%" colspan="4" height="66"> <p align="center">
<input type="submit" value="删除留言" name="B1">
<script language="javascript">
function CheckAll()
{
for (var i=0;i<document.form1.elements.length;i++)
{
document.form1.elements[i].checked=document.form1.chkall.checked
}
}
function chk()
{
for (var i=0;i<document.form1.elements.length;i++)
{
if (document.form1.elements[i].checked)
{
return 1;
}
}
return 0;
}
function frm_submit()
{
if (!chk())
{
alert("请先选择欲删除的记录。");
return false;
}
else
{
if (confirm('您确实要删除选中的项?此操作不可恢复。'))
{
document.form1.submit();
}
else
{
return false;
}
}
}
</script>
</td>
</tr>
<tr valign="bottom">
<td width="100%" colspan="4" align="center" height="15">
<div align="center">
<% if cint(curpage)<>1 then %>
<a href="?curpage=1">首页 </a>
<% else %>
首页
<% end if %>
<% if cint(curpage)>1 then %>
<a href="?curpage=<%=curpage-1%>">上一页 </a>
<% else %>
上一页
<% end if %>
<% if cint(curpage)<>cint(totalpages) then %>
<a href="?curpage=<%=curpage+1%>"> 下一页
<% else %>
下一页
<% end if %>
<% if cint(curpage)<>cint(totalpages) then %>
</a><a href="?curpage=<%=totalpages%>"> 末页
<% else %>
末页
<% end if %>
</a>
<select name="menu1" onChange="MM_jumpMenu('self',this,0)">
<option value="#" selected>请选择</option>
<option>
<%
k=1
do while k<=totalpages
%>
</option>
<option>
<%
k=1
do while k<=totalpages
%>
</option>
<option>
<%
k=1
do while k<=totalpages
%>
</option>
<option value="?curpage=<%=k%>">第<%=k%>页</option>
<option>
<%
k=k+1
loop
%>
</option>
<option>
<%
k=k+1
loop
%>
</option>
<option>
<%
k=k+1
loop
%>
</option>
</select>
</div></td>
</tr>
</table>
</center>
</div>
</form><%
end sub
sub saveadd
id=request("id")
body=dvHTMLEncode(request("body"))
body=replace(body,vbcrlf,"<br>")
conn.execute"update gbook set book_back=1 where id="&id&""
sql="insert into gbook_back(back_id,back_meno)values("&id&",'"&body&"')"
conn.execute sql
response.redirect"guestbook.asp"
end sub
sub del
ids=split(request("id"),",")
for i=0 to ubound(ids)
tt=ids(i)
conn.execute"delete from gbook where id="&tt&""
conn.execute"delete from gbook_back where back_id="&tt&""
next
response.redirect"guestbook.asp?action=list1"
end sub
conn.close
set conn=nothing%>
<!--#include file="end.asp" -->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -