在后台管理页面,加一个审核链接,点击就改变LOCK 为TRUE 或者 FALSE 状态,提交到LOCK.ASP
<a href="lock.asp?id=<%=rs("id")%>
<%
if rs("lock")=TRUE then
response.write "已审核"
else
response.write "末审核"
end if
%>
</a>
LOCK.ASP 程序
<!--#include file="conn.asp"--> '数据库连接
<%
id=request("id") ’获得留言编号
set rs=server.createobject("adodb.recordset")
sql="select lock from 留言表 where id="&id
rs.open sql,conn,1,3
if rs("lock")=True then
rs("lock")=False
else
rs("lock")=True
end if
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.Redirect "XXX.asp" ‘返回后台审核页面
%>
至于前台显示留言内容的页面SQL语句,加一个 LOCK=TRUE 就行了
例如
sql = "Select * FROM 留言表 WHERE LOCK=TRUE Order By ID Desc"