📄 save_edit.asp
字号:
<%
if instr(session("flag"),"11")=0 then
response.redirect "../login.asp"
response.end
end if
%>
<!--#include file="../../conn/dbconn2.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../../inc/config.asp"-->
<!--#include FILE="../../inc/upload_5xsoft.inc"-->
<%
set upload=new upload_5xSoft
if Chkrequest(upload.form("info_id")) then
info_id=upload.form("info_id")
else
Response.Redirect ("../../login/chklogin.asp?login=4")
end if
p_z_Z_Type=Replace_Text(upload.form("p_z_Z_Type"))
p_z_Z_Subject=Replace_Text(upload.form("p_z_Z_Subject"))
sortid=Replace_Text(upload.form("sortid"))
typeid=Replace_Text(upload.form("typeid"))
p_z_Z_Keywords=Replace_Text(upload.form("p_z_Z_Keywords"))
content=Replace_Text(upload.form("content"))
period=Replace_Text(upload.form("period"))
more_info=Replace_Text(upload.form("more_info"))
Specifications=Replace_Text(upload.form("Specifications"))
Quantity=Replace_Text(upload.form("Quantity"))
Packaging=Replace_Text(upload.form("Packaging"))
PriceTerms=Replace_Text(upload.form("PriceTerms"))
TrustpassFlag=Replace_Text(upload.form("TrustpassFlag"))
if TrustpassFlag="" then
TrustpassFlag=0
else
TrustpassFlag=1
end if
FeedbackFlag=Replace_Text(upload.form("FeedbackFlag"))
if FeedbackFlag="" then
FeedbackFlag=0
else
FeedbackFlag=1
end if
if upload.form("cimg")=2 then
filepath=newspic&upload.form("img")
set fs=server.CreateObject("scripting.filesystemobject")
filepath=server.MapPath(filepath)
formPath=newspic
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 picture from info where info_id="&info_id&""
set rs=conn.Execute(sql)
if fs.FileExists(filepath) and rs("picture")<>"nopicture.gif" then
fs.DeleteFile filepath,true
end if
FileName=MakedownName()&"."&mid(file.FileName,InStrRev(file.FileName, ".")+1)
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 info where info_id="&info_id&""
'response.write sql
rs.open sql,conn,1,3
rs("type")=p_z_Z_Type
rs("showname")=p_z_Z_Subject
rs("sortid")=sortid
rs("typeid")=typeid
rs("keywords")=p_z_Z_Keywords
rs("content")=content
rs("period")=period
if upload.form("cimg")=2 then
if trim(right(picture,3))="jpg" or trim(right(picture,3))="gif" then
rs("picture")=picture
end if
end if
rs("Specifications")=Specifications
rs("Quantity")=Quantity
rs("Packaging")=Packaging
rs("PriceTerms")=PriceTerms
rs("TrustpassFlag")=TrustpassFlag
rs("FeedbackFlag")=FeedbackFlag
rs("dateandtime")=now()
rs.update
rs.close
set rs=noting
conn.close
set conn=nothing
set upload=nothing
response.write"<SCRIPT language=JavaScript> this.location.href='javascript:window.history.go(-2)';</SCRIPT>"
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -