📄 photo_del.asp
字号:
<!--插入html头部分以及数据库接口-->
<!--#include file="in_conn.asp"-->
<%
'获取传值
dim vpid
vpid=Request.QueryString("id")
if isNumeric(vpid) then
vpid=CLng(vpid)
else
Response.Redirect "resp.asp?cmd=ph_idmiss"
end if
%>
<body>
<!--插入网站置顶-->
<% if u_name="" then
Response.Redirect "log_err.asp"
else
%>
<!--#include file="in_topmb.asp"-->
<% end if %>
<table align="center" width="700" height="50" border="0" cellspacing="0" cellpadding="11" class="rdkuang"><tr>
<td width="100%" height="100%" align="center">
<%
'找出相应记录
sqlstr="SELECT p_ID,p_author,p_url FROM tblphoto WHERE p_ID="&vpid
rs.open sqlstr,conn,1,3
if rs.eof AND rs.bof then
Response.Redirect "resp.asp?cmd=ph_idmiss"
end if
'检查资格身份
if rs("p_author")<>u_name AND u_power<2 then
Response.Write "<img src='img/jjerr.gif' border='0'> 很抱歉,你不是该照片的上传者,您没有删除该照片的权限!"
else
'删除照片文件以及相关记录
if rs("p_url")<>"" then
dim phpath
dim fso1
phpath=server.MapPath(rs("p_url"))
set fso1=Server.CreateObject("Scripting.FileSystemObject")
if fso1.FileExists(phpath) then
fso1.DeleteFile phpath,True
end if
set fso1=nothing
end if
sqlstr="DELETE FROM tblphoto WHERE p_belong="&vpid
conn.Execute sqlstr
rs.delete
rs.update
Response.Write "<img src='img/jjgo.gif' border='0'> OK,删除照片成功!"
end if
rs.close
%>
<br><a href="phbook.asp">[点击这里返回<font class="ft1">相册首页</font>]</a><br>
</td>
</tr></table>
<br>
<!--插入在线统计-->
<!--#include file="in_online.asp"-->
<!--插入网站置底-->
<!--#include file="in_bottom.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -