gusucode.com > ASP+ACCESS中学网站设计与实现(论文+源代码+开题报告+任务书) > ASP+ACCESS中学网站设计与实现(论文+源代码+开题报告+任务书)\ASP001中学网站设计与实现\zxweb\lyb\del.asp

    <%@ language=VBScript %>
<!--#include file="setup.asp"-->
<%

if Request("menu") = "del" then
call del()
else call index()
end if

sub index()

%>
<html><head><title>删除留言</title>
<link rel="stylesheet" href="images/gbook.css">
</head>
<!--#include file="inctop.asp"--><body topmargin=0>
<div align="center"><img src="images/logo.jpg" width="759" height="110"></div>
<table width=760 height="27" border=0 align="center" cellpadding=0 cellspacing=1 background="images/dh.gif" style="border: 1px solid #CCCCCC;">
  <tr> 
    <td width="510" height="27"> <img src="images/arrow3.gif" align=absmiddle width="29" height="11"> 
      您的位置: <b><font color="#FF0000"><a href="http://swbiz.21e.cn"><font color="#6600FF"></font></a></font></b> 
      >> <a href=index.asp>留言本首页</a> >> <a href=index.asp>浏览留言</a> >> 删除留言</td>
    <td width="245"><DIV align=center>【<a href="index.asp">查看留言</a>】  【<a href="write.asp">签写留言</a>】</DIV></td>
  </tr>
</table>
<br>
<table width="760" border="0" cellspacing="1" cellpadding="4" align="center" bgcolor="#FFFFF0">
  <tr> 
    <td width="181" height="113" bgcolor="#FFFFF0"> </td>
    <td width="12" bgcolor="#FFFFF0"></td>
    <td width="539" bgcolor="#FFFFF0"> 
      <form method="post" action="del.asp">
        <input type=hidden name=id value=<%=Request("id")%>>
        <input type=hidden name=menu value=del><table width="100%" border="0" cellspacing="2" cellpadding="6" align="center"> 
        <tr> 
          <td width="24%" height="24" align="center" nowrap bgcolor="#FFFFF0">管理口令:</td>
            
          <td width="76%" height="24" nowrap bgcolor="#FFFFF0"> 
            <input type="password" name="password" size="20" style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''" value=<%=Request.cookies("password")%>> 
              <input type=checkbox name=save value=save <%if Request.cookies("save") <> "" then%>checked<%end if%>>
            记住密码 </td>
          </tr>
          
        <tr> 
          <td width="24%" height="16" align="center" nowrap>请选择:</td>
            
          <td width="76%" height="16" nowrap bgcolor="#FFFFF0"> 
            <input type="radio" name="select" value="this" checked>
              删除该条留言 &nbsp;&nbsp; <input type="radio" name="select" value="all">
            清空所有留言 </td>
          </tr>
          
        <tr> 
          <td width="24%" height="20" nowrap bgcolor="#FFFFF0"> <br> </td>
            
          <td width="76%" height="20" nowrap bgcolor="#FFFFF0"> &nbsp;&nbsp; 
            <input type="submit" name="Submit" value="删 除" style="backgroud-color: #ffffff; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; FONT-FAMILY: 宋体; FONT-SIZE: 9pt; HEIGHT: 18px; WIDTH: 50px"> 
              <input type="reset" name="Submit2" value="重 置" style="backgroud-color: #ffffff; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; FONT-FAMILY: 宋体; FONT-SIZE: 9pt; HEIGHT: 18px; WIDTH: 50px"> 
              <input type="button" name="Submit3" value="取 消" onClick="javascript:history.back(-1);" style="backgroud-color: #ffffff; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; FONT-FAMILY: 宋体; FONT-SIZE: 9pt; HEIGHT: 18px; WIDTH: 50px">
          </td>
          </tr></form>
        </table>
      </td>
  </tr>
</table>
<br>
<table width=760 height="22" border=0 align="center" cellpadding=0 cellspacing=1 background="images/dh.gif" style="border: 1px solid #CCCCCC;">
  <tr> 
    <td width="510" height="18">&nbsp;</td>
    <td width="245">&nbsp;</td>
  </tr>
</table>
<%
call htmlend()

Response.End
end sub

sub del()

password = Request.form("password")
id = Request.form("id")
save = Request.form("save")

if id = "" then
message=message&"对不起,你的删除记录号不能为空!\n"
end if

if password <> passwords then
message=message&" 您的管理口令不正确!\n"
end if
on error resume next
if message <> "" then
	call error(""&message&"")
	Response.end
	else


	if Request.form("select") = "this" then

	sql = "delete * from gbook where id=" & id
	Set Rs = Server.CreateObject("ADODB.Recordset")
	Rs.open sql,conn,3,1
	Rs.close

	sql = "delete * from reply where replyid=" & id
	Rs.open sql,conn,3,1
	Rs.close

	sql = "select * from admin"
	Rs.open sql,conn,3,2

	if Rs("today_count") > 0 then
	Rs("today_count") = Rs("today_count")-1
	else Rs("today_count") = 0
	end if

	Rs("today_time") = date
	Rs.update
	Rs.close


	elseif Request.form("select") = "all" then

	sql = "delete * from gbook"
	Set Rs = Server.CreateObject("ADODB.Recordset")
	Rs.open sql,conn,3,1
	Rs.close

	sql = "delete * from reply"
	Rs.open sql,conn,3,1
	Rs.close

	sql = "select * from admin"
	Rs.open sql,conn,3,2
	Rs("today_count") = 0
	Rs("today_time") = date
	Rs.update
	Rs.close

	end if

	if save <> "" then
	Response.cookies("password") = password
	Response.cookies("save") = save
	else
	Response.cookies("password") = ""
	Response.cookies("save") = ""
	end if

set Rs = nothing
conn.close
set conn = nothing

Response.redirect "index.asp"
Response.End
end if
end sub
%>