主题:[讨论]留言板的后台清空留言后,前台不能留言了,求助
我在后台清空所有的留言后,再在前台留言,居然不能留言了。百思不得其解。请大家帮分析一下我的程序。以下是留言板后台的程序
<!--#include file="../inc/config2.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/admin.css" rel="stylesheet" type="text/css" />
<title>留言管理</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
.STYLE1 {
color: #135294;
font-weight: bold;
font-size: 14px;
}
.STYLE4 {color: #135294; font-weight: bold; }
-->
</style>
<script language="JavaScript" type="text/javascript" src="../js/jQuery.js"></script>
<script language="JavaScript" type="text/javascript" src="../js/jQuery.form.js"></script>
<script language="JavaScript" type="text/javascript" src="../js/Fun.js"></script>
<script language="javascript" type="text/javascript" src="../js/thickbox.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>留言管理</title>
</head>
<body>
<% dim a_user
a_user=session("admin_user")
if (a_user="") then
call showerr("请先登录!","login.html")
else
end if
%>
<% dim types, n
int n=1
types=request.QueryString("types")
id=request.QueryString("id")
select case types
case 1
set rsb=server.createobject("adodb.recordset")
sqlstr="select * from [liuyan]"
rsb.open sqlstr,conn,1,3
%>
<form name="classediter" id="classediter" method="post" action="liuyan_editer.asp?types=6">
</form>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#C4D8ED">
<tr>
<td height="30" colspan="2" align="center" bgcolor="#E4EDF9"><span class="STYLE1">留言管理</span></td>
</tr>
<%
do while not rsb.eof
%>
<tr>
<td width="19%" height="25" align="right" bgcolor="#FFFFFF" class="STYLE4"><p><font color="#999999"><%=rsb("time")%></font></p>
<p>用户名:<font color="#999999"><font color="#999999"><%=rsb("user_name")%></font></font> </p></td>
<td width="81%" height="25" align="left" bgcolor="#FFFFFF"><textarea name="t2" cols="60" readonly="readonly" rows="3" ><%=rsb("content")%> </textarea>
<% if(rsb("huifu")="") then %>
<%else%>
<br/>
<br/>
<textarea name="t1" cols="60" readonly="readonly" style="background-color:#FFFFFF" rows="3" ><%=rsb("huifu")%> </textarea>
<%end if%>
<a href="liuyan_editer.asp?id=<%=rsb("id")%>&types=5"> 回复管理</a> <a href="liuyan_editer.asp?id=<%=rsb("id")%>&types=4"> 删除</a></td>
</tr>
<% rsb.movenext
loop %>
<%
rsb.close
set rsb=nothing
%>
<tr>
<td height="25" align="right" bgcolor="#FFFFFF" class="STYLE4"> </td>
<td height="25" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="25" colspan="2" bgcolor="#FFFFFF" align="center"> </td>
</tr>
<tr> </tr>
</table>
<%
case 2
huifu=trim(request.Form("huifu"))
content=trim(request.Form("content"))
set rsb=server.createobject("adodb.recordset")
sqlstr="select * from [liuyan]"
rsb.open sqlstr,conn,1,3
rsb.addnew
rsb("huifu")=title
rsb("content")=content
rsb.update
rsb.close
set rsb=nothing
response.Redirect("liuyan_editer.asp?types=1")
%>
<%
case 3
id=request.QueryString("id")
huifu=trim(request.Form("huifu"))
content=trim(request.Form("content"))
set rsb=server.createobject("adodb.recordset")
sqlstr="select * from [liuyan] where id="&id
rsb.open sqlstr,conn,1,3
rsb("content")=content
rsb("huifu")=huifu
rsb.update
response.Redirect("liuyan_editer.asp?types=1")
rsb.close
set rsb=nothing
%>
<%
case 4
id=request.QueryString("id")
set rsb=server.createobject("adodb.recordset")
sqlstr="delete * from [liuyan] where id="&id
rsb.open sqlstr,conn,1,3
response.Redirect("liuyan_editer.asp?types=1")
rsb.close
%>
<%
case 5
id=request.QueryString("id")
set rsb=server.createobject("adodb.recordset")
sqlstr="select * from [liuyan] where id="&id
rsb.open sqlstr,conn,1,3
%>
<form name="editer" method="post" action="liuyan_editer.asp?id=<%=rsb("id")%>&types=3">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#C4D8ED">
<tr>
<td height="30" colspan="2" align="center" bgcolor="#E4EDF9"><span class="STYLE1">留言管理</span></td>
</tr>
<tr>
<td width="19%" height="25" align="right" bgcolor="#FFFFFF" class="STYLE4"><p><font color="#999999"><font color="#999999"><%=rsb("time")%></font></font></p>
<p>用户名<font color="#999999">[<font color="#999999"><%=rsb("user_name")%></font>]</font> </p></td>
<td width="81%" height="25" align="left" bgcolor="#FFFFFF"><textarea name="content" cols="60" rows="3" ><%=rsb("content")%> </textarea>
<br/><br/>
<textarea name="huifu" cols="60" style="background-color:#FFFFFF" rows="3" ><%=rsb("huifu")%> </textarea></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#FFFFFF" class="STYLE4"> </td>
<td height="25" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="25" colspan="2" bgcolor="#FFFFFF" align="center"><input type="submit" value="确定" /></td>
</tr>
<tr> </tr>
</table>
</form>
<%
rsb.close
set rsb=nothing
end select
%>
</body>
</html>
</div>
<!--#include file="../inc/config2.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/admin.css" rel="stylesheet" type="text/css" />
<title>留言管理</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
.STYLE1 {
color: #135294;
font-weight: bold;
font-size: 14px;
}
.STYLE4 {color: #135294; font-weight: bold; }
-->
</style>
<script language="JavaScript" type="text/javascript" src="../js/jQuery.js"></script>
<script language="JavaScript" type="text/javascript" src="../js/jQuery.form.js"></script>
<script language="JavaScript" type="text/javascript" src="../js/Fun.js"></script>
<script language="javascript" type="text/javascript" src="../js/thickbox.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>留言管理</title>
</head>
<body>
<% dim a_user
a_user=session("admin_user")
if (a_user="") then
call showerr("请先登录!","login.html")
else
end if
%>
<% dim types, n
int n=1
types=request.QueryString("types")
id=request.QueryString("id")
select case types
case 1
set rsb=server.createobject("adodb.recordset")
sqlstr="select * from [liuyan]"
rsb.open sqlstr,conn,1,3
%>
<form name="classediter" id="classediter" method="post" action="liuyan_editer.asp?types=6">
</form>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#C4D8ED">
<tr>
<td height="30" colspan="2" align="center" bgcolor="#E4EDF9"><span class="STYLE1">留言管理</span></td>
</tr>
<%
do while not rsb.eof
%>
<tr>
<td width="19%" height="25" align="right" bgcolor="#FFFFFF" class="STYLE4"><p><font color="#999999"><%=rsb("time")%></font></p>
<p>用户名:<font color="#999999"><font color="#999999"><%=rsb("user_name")%></font></font> </p></td>
<td width="81%" height="25" align="left" bgcolor="#FFFFFF"><textarea name="t2" cols="60" readonly="readonly" rows="3" ><%=rsb("content")%> </textarea>
<% if(rsb("huifu")="") then %>
<%else%>
<br/>
<br/>
<textarea name="t1" cols="60" readonly="readonly" style="background-color:#FFFFFF" rows="3" ><%=rsb("huifu")%> </textarea>
<%end if%>
<a href="liuyan_editer.asp?id=<%=rsb("id")%>&types=5"> 回复管理</a> <a href="liuyan_editer.asp?id=<%=rsb("id")%>&types=4"> 删除</a></td>
</tr>
<% rsb.movenext
loop %>
<%
rsb.close
set rsb=nothing
%>
<tr>
<td height="25" align="right" bgcolor="#FFFFFF" class="STYLE4"> </td>
<td height="25" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="25" colspan="2" bgcolor="#FFFFFF" align="center"> </td>
</tr>
<tr> </tr>
</table>
<%
case 2
huifu=trim(request.Form("huifu"))
content=trim(request.Form("content"))
set rsb=server.createobject("adodb.recordset")
sqlstr="select * from [liuyan]"
rsb.open sqlstr,conn,1,3
rsb.addnew
rsb("huifu")=title
rsb("content")=content
rsb.update
rsb.close
set rsb=nothing
response.Redirect("liuyan_editer.asp?types=1")
%>
<%
case 3
id=request.QueryString("id")
huifu=trim(request.Form("huifu"))
content=trim(request.Form("content"))
set rsb=server.createobject("adodb.recordset")
sqlstr="select * from [liuyan] where id="&id
rsb.open sqlstr,conn,1,3
rsb("content")=content
rsb("huifu")=huifu
rsb.update
response.Redirect("liuyan_editer.asp?types=1")
rsb.close
set rsb=nothing
%>
<%
case 4
id=request.QueryString("id")
set rsb=server.createobject("adodb.recordset")
sqlstr="delete * from [liuyan] where id="&id
rsb.open sqlstr,conn,1,3
response.Redirect("liuyan_editer.asp?types=1")
rsb.close
%>
<%
case 5
id=request.QueryString("id")
set rsb=server.createobject("adodb.recordset")
sqlstr="select * from [liuyan] where id="&id
rsb.open sqlstr,conn,1,3
%>
<form name="editer" method="post" action="liuyan_editer.asp?id=<%=rsb("id")%>&types=3">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#C4D8ED">
<tr>
<td height="30" colspan="2" align="center" bgcolor="#E4EDF9"><span class="STYLE1">留言管理</span></td>
</tr>
<tr>
<td width="19%" height="25" align="right" bgcolor="#FFFFFF" class="STYLE4"><p><font color="#999999"><font color="#999999"><%=rsb("time")%></font></font></p>
<p>用户名<font color="#999999">[<font color="#999999"><%=rsb("user_name")%></font>]</font> </p></td>
<td width="81%" height="25" align="left" bgcolor="#FFFFFF"><textarea name="content" cols="60" rows="3" ><%=rsb("content")%> </textarea>
<br/><br/>
<textarea name="huifu" cols="60" style="background-color:#FFFFFF" rows="3" ><%=rsb("huifu")%> </textarea></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#FFFFFF" class="STYLE4"> </td>
<td height="25" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="25" colspan="2" bgcolor="#FFFFFF" align="center"><input type="submit" value="确定" /></td>
</tr>
<tr> </tr>
</table>
</form>
<%
rsb.close
set rsb=nothing
end select
%>
</body>
</html>
</div>