📄 edit_save.asp
字号:
<link href="../css/style.css" rel="stylesheet" type="text/css">
<%
if Request.Cookies("globalec")("globalecmaster")="" or Request.Cookies("globalec")("masterflag")="" then
response.write "<script language='javascript'>"
response.write"this.location.href='../login.asp';</SCRIPT>"
response.end
end if
if instr(Request.Cookies("globalec")("masterflag"),"24")=0 then
response.redirect "../err.asp"
response.end
end if
%>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include FILE="../../inc/upload_5xsoft.inc"-->
<%
set upload=new upload_5xSoft
if Chkrequest(upload.form("id")) then
id=upload.form("id")
else
Response.Redirect ("/login/chklogin.asp?login=4")
end if
typename1=Replace_Text(upload.form("typename"))
alt=Replace_Text(upload.form("content"))
type1=Replace_Text(upload.form("type1"))
cimg=Replace_Text(upload.form("cimg"))
img=Replace_Text(upload.form("img"))
if cimg=2 then
filepath="/company/"&img
set fs=server.CreateObject("scripting.filesystemobject")
filepath=server.MapPath(filepath)
formPath="/company/"
formPath2="modpic/"
if right(formPath,1)<>"/" then formPath=formPath&"/"
'iCount=0
for each formName in upload.objFile
set file=upload.file(formName)
if file.FileSize>0 then
if file.filesize>200000 then
response.write"<SCRIPT language=JavaScript>alert('您上传的图片大于规定大小(200K),请改变文件大小后再进行上传。');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
if trim(right(file.FileName,3))<>"jpg" and trim(right(file.FileName,3))<>"gif" then
response.write"<SCRIPT language=JavaScript>alert('您上传的文件必须是GIF或JPG图象文件,请将你上传的文件转换此格式后再进行上传。');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
sql="select src from mod where id="&id&""
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if fs.FileExists(filepath) and rs("src")<>"nopicture.gif" then
fs.DeleteFile filepath,true
end if
FileName=formPath2&MakedownName()&"."&mid(file.FileName,InStrRev(file.FileName, ".")+1)
Dim objFSO '声明一个名称为 objFSO 的变量以存放对象实例
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(Server.MapPath(""&formPath&""&formPath2&"")) Then'如果存在就直接保存图片
file.SaveAs Server.mappath(formPath&thename)
Else
objFSO.CreateFolder(Server.MapPath(""&formPath&""&formPath2&""))'不存在就建一个目录
file.SaveAs Server.mappath(formPath&thename)
End If
Set objFSO = Nothing '释放 FileSystemObject 对象实例内存空间
file.SaveAs Server.mappath(formPath&FileName)
picture=FileName
'iCount=iCount+1
end if
next
set file=nothing
end if
set rs=server.createobject("adodb.recordset")
sql="select * from mod where id="&id
rs.open sql,conn,1,3
rs("typename") =typename1
rs("alt") =alt
if cimg=1 then
rs("src") =img
else
rs("src") =picture
end if
rs("type1")=type1
rs.update
rs.close
set rs=noting
conn.close
set conn=nothing
set upload=nothing
response.write"<table cellpadding=2 cellspacing=1 border=0 width=100% class=tableBorder align=center>"
response.write"<TR>"
response.write"<TH class=tableHeaderText colSpan=2 height=25>自助建站模版管理</TH>"
response.write"<TR><tr><td height=85 valign=top class=forumRow><div align=center><br><br>自助建站模版修改成功!</div></td></tr>"
response.write"<tr align=center><td height=30 class=forumRowHighlight><a href='index.asp'><< 返回上一页</a></td>"
response.write"</tr>"
response.write"</table>"
%>
<br>
<!--#include file="../copy.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -