发布网友 发布时间:2022-04-23 06:38
共1个回答
热心网友 时间:2022-04-10 05:42
<html>
<!-- #include file="mdb.asp" -->
<body>
<%on error resume next%>
<table width="586" height="576" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top" background="images/1.jpg">
<table width="586" height="576" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"><br>留言<hr width="95%">
<%
set rst=server.createobject("adodb.recordset")
rst.open "select * from liuyan order by l_uid desc",conn,1.1
dim uid
uid=request.querystring("uid")
if request.querystring("act")="shanchu" then
set rst1=server.createobject("adodb.recordset")
rst1.open "select * from liuyan where l_uid="&uid,conn,1,3
rst1.delete
rst1.close
response.Redirect("liuyan.asp")
'response.write("留言删除成功")
end if %>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<% If not rst.eof Then
tol=rst.recordcount
shownum=15
rst.pagesize=shownum
maxpage=rst.pagecount
requestpage=clng(request("p"))
if requestpage="" or requestpage<1 then
requestpage=1
end if
if requestpage>maxpage then
requestpage=maxpage
end if
if not requestpage=1 then
rst.move (requestpage-1)*rst.pagesize
end if
for i=1 to rst.pagesize and not rst.eof
%>
<tr>
<td width="71%"> <%response.write("用户:" & rst("l_id"))%></td>
<td width="29%" align="right"><%=rst("l_sj")%> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<%response.write("说:" & rst("l_ly"))%></td>
</tr>
<tr>
<td align="left" valign="top"> </td>
<td align="right"><%if session("ID")="hwbshuaige134" then%>
<a href="liuyan.asp?act=shanchu&uid=<%=rst("l_uid")%>" target="kj" class="STYLE1">删除</a>
<%end if%></td>
</tr>
<%
rst.movenext
if rst.eof then exit for
next
else
response.Write("没有您要查询的信息!")
end if
%>
</table>
<table width="90%" border="0" align="center">
<tr>
<td valign="top">
<div align="center"><span style="font-size: 9pt">共<%=tol %>条记录 共<font color=red><%=maxpage%></font>页 第<%=requestpage%>页 <font color=666666>
<%if requestpage-1>0 then%>
<a href="<%=path%>?p=<%=requestpage-1%>" class="t9b">上一页</a>
<%else%>
上一页
<%end if%>
<%if requestpage+1<=maxpage then%>
<a href="<%=path%>?p=<%=requestpage+1%>" class="t9b">下一页</a>
<%else%>
下一页</font>
<%end if%>
</span>
</div></td>
</tr>
<%Rst.Close
Set Rst=Nothing%></table>
<hr align="center" width="95%" size="1" color="#33CCFF" id="1">
</td>
</tr>
<tr>
<%
if request.querystring("act")="tijiao" then
if not session("acc") then
response.write("请先登录")
else
rst.open "liuyan",conn,1,3
rst.addnew
rst("l_id")=session("ID")
rst("l_sj")=now
rst("l_ly")=request.form("b_ly")
rst.update
rst.close
if err.number>0 then
response.write("留言不能为空")
else
response.Redirect("liuyan.asp")
'response.write("留言提交成功")
end if
end if
end if
%>
<td height="150" align="center" valign="top">在此写留言<br>
<form name="form1" method="post" action="liuyan.asp?act=tijiao">
<p>
<textarea name="b_ly" cols="75" rows="5" id="b_ly"></textarea>
</p>
<p>
<input type="submit" name="Submit" value="提交">
</p>
</form></td>
</tr>
</table></td>
</tr>
</table>
<%
set rst=nothing
conn.close
set conn=nothing
%>
</body>
</html>
试试这个