⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 del.asp

📁 我的课程设计
💻 ASP
字号:
<%@ language=VBScript %>
<!--#include file="setup.asp"-->
<%

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

sub index()

%>
<html><head><title><%=gbook_name%>--删除留言</title>
<link rel="stylesheet" href="../css/admin.css">
</head>
<body topmargin=0 >
<table width=600 height="27" border=1 bordercolor="#FFFFFF" align="center" cellpadding=0 cellspacing=1 style="border: 1px solid #CCCCCC;">
  <tr> 

    <td width="245"><div align="right">【<a href="index.asp">查看留言</a>】  【<a href="write.asp">签写留言</a>】</div></td>
  </tr>
</table>
<table width="600" border="0" cellspacing="1" cellpadding="4" align="center" bgcolor="#CCCCCC">
  <tr bgcolor="#ebebeb"> 
    <td width="181" height="113"> </td>
    <td width="12" bgcolor="#FFFFFF"></td>
    <td width="539"><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 bgcolor="#FFFFFF"> 
            <td width="24%" height="25" align="center" nowrap>管理口令:</td>
            <td width="76%" height="25" nowrap> 
              <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 bgcolor="#FFFFFF"> 
            <td width="24%" height="16" align="center" nowrap>请选择:</td>
            <td width="76%" height="16" nowrap> 
              <input type="radio" name="select" value="this" checked>
              删除该条留言 &nbsp;&nbsp; <input type="radio" name="select" value="all">
              清空所有留言 </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td width="24%" height="20" nowrap> <br> </td>
            <td width="76%" height="20" nowrap> &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>
</body>

<%
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
%>
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -