回 帖 发 新 帖 刷新版面

主题:[讨论]留言板的后台清空留言后,前台不能留言了,求助

我在后台清空所有的留言后,再在前台留言,居然不能留言了。百思不得其解。请大家帮分析一下我的程序。以下是留言板后台的程序
<!--#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> &nbsp;</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%>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="liuyan_editer.asp?id=<%=rsb("id")%>&types=5"> 回复管理</a>&nbsp;&nbsp;&nbsp;&nbsp;<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">&nbsp;</td>
    <td height="25" bgcolor="#FFFFFF">&nbsp;&nbsp;</td>
  </tr>
  <tr>
    <td height="25" colspan="2" bgcolor="#FFFFFF" align="center">&nbsp;</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> &nbsp;</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">&nbsp;</td>
    <td height="25" bgcolor="#FFFFFF">&nbsp;&nbsp;</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>

回复列表 (共2个回复)

沙发

留言板前台程序如下:

<div class="wai2">
<div class="left2">

    <div class="left2_content">
        <div class="title_245"><img src="images/zixun.gif"  width="97" height="29" /></div>
  <div class="bian_245">
  <ul class="leibiao" width="96%" align="left">
    <% if (classid2<>"") then
    sqlstr="select * from [liuyan]  where class_id="&classid2&" order by id desc"
    else
    sqlstr="select * from [liuyan] order by id desc"
    end if
    rs.open sqlstr,conn,1,3
    if not rs.eof then
    article_size=9
    rs.pagesize=article_size
    page_now=1
    if trim(request.QueryString("page"))<>"" then
    page_now=cint(trim(request.QueryString("page")))
    end if
    if page_now>rs.pagecount or page_now<0 then
    page_now=1
    end if 
    page_count=rs.pagecount
    rs.absolutepage=page_now
    i=1
    while (not rs.eof) and i<article_size+1
    
    %>        

    <li> <a href="liuyan.asp?classid3=<%=rs("id")%>"><%=cutstr(rs("title"),11)%></a> 
            <%if rs("time")=date()  or rs("time")=date()-1 then%>
            <img src="images/gaiban/i_r29_c108.jpg" width="19" height="9" hspace="5" />
                                  <% end if %><font color="#FF6600"><%=cutstr2(rs("time"),10)%></font></a>
  </li>
   <%
    rs.movenext
      i=i+1
      wend
    %>
    <div><%=jk_pagecute(article_size,page_count,page_now,"?",9,"#ff0000")%></div>
    <%
    else
    %>
      <div>没有信息</div>
       <%
    end if
    rs.close
    %>

板凳

问题不在这里

我来回复

您尚未登录,请登录后再回复。点此登录或注册