📄 film_del.asp
字号:
<!--#include file="chklogin.asp"-->
<%
call myobj.chkrq()
if request.QueryString("id")="" or myobj.ChkNum(request.QueryString("id"))=false then
response.write"<script language=javascript>alert('影片ID值错误');history.back();</Script>"
response.end
end if
'#####判断该ID值是否存在
set rs=server.createobject("adodb.recordset")
rs.open "select * from films where id="&request.QueryString("id")&"",conn,1,1
if rs.eof then
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write"<script language=javascript>alert('该影片不存在');history.back();</Script>"
response.end
else
film_name=rs("film_name") '取得影片名称
film_pic=rs("film_pic") '取得影片海报文件名
rs.close
end if
conn.execute"delete from films where id="&request.QueryString("id")&""
conn.execute"delete from film_files where filmid="&request.QueryString("id")&""
conn.execute"delete from film_fav where film_id="&request.QueryString("id")&""
set rs=server.createobject("adodb.recordset")
rs.open "select del_filmpic from setup",conn,1,1
if rs("del_filmpic")=true then '如果自动删除开启
auto_del=true '标识自动删除开启
set objFile=server.CreateObject ("Scripting.FileSystemObject")
pic_name=server.MapPath ("../filmpic/"&film_pic)
if objfile.FileExists(pic_name) then '如果原文件存在
objfile.DeleteFile (pic_name)
if objfile.FileExists(pic_name) then '删除后再次查询如果存在
err_msg=2 '执行了删除操作,但原文件仍然存在,删除失败
else
err_msg=3 '删除成功
end if
else '否则
err_msg=1 '原文件不存在,自动删除失败
end if
else
auto_del=false '标识自动删除关闭
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>删除影片</title>
<link href="images/style2.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
a:link {
color: #0000FF;
text-decoration: none;
}
a:visited {
color: #0000FF;
text-decoration: none;
}
a:hover {
color: #FF0000;
text-decoration: underline;
}
a:active {
text-decoration: none;
}
-->
</style>
</head>
<body leftMargin="0" topMargin="0" bgcolor="#FFFFFF">
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="550" height="25" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#3975CE">
<tr>
<td align="center" class="font1"><strong>删除影片<strong>《<strong>
<%
if myobj.ChkLen(film_name)<10 then
response.write(film_name)
else
response.write(left(film_name,10)&"…")
end if
%>
</strong>》</strong></strong></td>
</tr>
</table>
<table width="550" height="200" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td align="center" bgcolor="#F7F7F7"><table width="500" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">影片删除成功!</td>
</tr>
</table>
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="25">图片自动删除功能:
<%if auto_del=true then%>
开启
<%else%>
关闭
<%end if%></td>
</tr>
<tr>
<td height="25">图片文件名:<%if film_pic="" or isnull(film_pic) then%>该影片没有海报文件<%else%><%=film_pic%><%end if%></td>
</tr>
<tr>
<td height="25">图片是否删除成功:<%if auto_del<>false then%>
<%if film_pic="" or isnull(film_pic) then%>
原文件不存在,无需删除
<%end if%>
<%if film_pic<>"" and err_msg=2 then%>
执行了删除操作,但原文件仍然存在,删除失败
<%end if%>
<%if film_pic<>"" and err_msg=3 then%>
删除成功
<%end if%>
<%else%>
不执行自动删除操作
<%end if%></td>
</tr>
<tr>
<td height="25"> </td>
</tr>
</table>
<table width="500" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><a href="film_manage.asp">返回影片管理</a> <a href="film_add.asp">增加新影片</a></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -