📄 saveedit.asp
字号:
<%OPTION EXPLICIT%>
<!--#include FILE="upload_5xsoft.inc"-->
<!--#include file="conn.asp"-->
<html>
<body>
<%
dim upload,file,formName,formPath,iCount,title,typeid,tjnews,content,selectpic,from,picurl,rs
dim newsid,sql
set upload=new upload_5xSoft
formPath=upload.form("filepath")
if right(formPath,1)<>"/" then formPath=formPath&"/"
newsid=upload.form("newsid")
title=upload.form("title")
if upload.form("checkbox1")="1" then
tjnews=1
else
tjnews=0
end if
content=upload.form("content")
from=upload.form("from")
if upload.form("checkbox3")="1" then
selectpic=1
else
selectpic=0
end if
iCount=0
for each formName in upload.file ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
if file.filesize>20000 then
HtmEnd "您上传的文件大于规定大小(20K),请改变文件大小后再进行上传。"
else
if trim(right(file.FileName,3))<>"jpg" and trim(right(file.FileName,3))<>"gif" then
HtmEnd "您上传的文件GIF或JPG图象文件,请将你上传的文件转换此格式后再进行上传。"
else
file.SaveAs Server.mappath(formPath&file.FileName) ''保存文件
picurl=file.FileName
iCount=iCount+1
end if
end if
end if
set file=nothing
next
set rs=server.createobject("adodb.recordset")
sql="select * from news where newsid="&cstr(newsid)
rs.open sql,conn,1,3
rs("title")=title
rs("content")=content
rs("nfrom")=from
rs("selectpic")=selectpic
rs("tjnews")=tjnews
if picurl<>"" then
rs("picurl")=picurl
end if
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
set upload=nothing
response.redirect "default.asp"
sub HtmEnd(Msg)
set upload=nothing
response.write "<br>"&Msg&" [<a href=""javascript:history.back();"">返回</a>]</body></html>"
response.end
end sub
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -