savefile.asp
来自「以朱朱相册为程序原型整合开发winds相册」· ASP 代码 · 共 81 行
ASP
81 行
<!--#include file="checkthis.asp" -->
<!--#include file="data/conn.asp" -->
<!--#include file="info.asp" -->
<%
on error resume next
if Request.QueryString("cz")="" then
Response.Redirect"info.asp?info=错误的参数"
else
cz=Request.QueryString("cz")
end if
if cz="del" then
set rs=server.createobject("adodb.recordset")
sql="select * from desktop where id="&Request.QueryString("id")
rs.open sql,conn,1,3
fn=rs("url")
filepath=Server.MapPath(fn)
'response.write filepath
'response.end
Set Fso=server.createobject("scripting.filesystemobject")
Fso.DeleteFile(Filepath)
fn=rs("surl")
filepath=Server.MapPath(fn)
'response.write filepath
'response.end
Set Fso=server.createobject("scripting.filesystemobject")
Fso.DeleteFile(Filepath)
set Fso=nothing
conn.execute "delete from desktop where id="&Request.QueryString("id")
%>
<script>
function window.onbeforeunload(){
window.opener.location.reload()
}
</script>
<%
response.write "<SCRIPT language=JavaScript>alert('删除成功!');"
response.write "this.location.href='javascript:window.close()';</SCRIPT>"
else
REM ------判断数据有效性------
if trim(Request.Form("name"))="" then
founderr=true
info=info+"<li>请填写文件名称</li>"
end if
if trim(Request.Form("typeid"))="" then
founderr=true
info=info+"<li>请选择分类</li>"
end if
REM ------如果数据是有效的则开始存储数据并显示相关信息------
set rs=server.createobject("adodb.recordset")
sql="select * from desktop where id="&Request.QueryString("id")
rs.open sql,conn,1,3
rs("name")=Request.Form("name")
rs("zhuanti")=Request.Form("zhuanti")
if Request.Form("jj")<>"" then
rs("jj")=HTMLEncode2(Request.Form("jj"))
end if
rs.update
rs.close
set rs=nothing
conn.close
Set conn=Nothing
Response.Redirect"addfile.asp?typeid="&Request.Form("zhuanti")
REM ------如果数据是无效的则开始显示错误信息------
call infom()
end if
function HTMLEncode2(fString)
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
HTMLEncode2 = fString
end function
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?