up.asp

来自「asp」· ASP 代码 · 共 77 行

ASP
77
字号
<%response.expires=0%>
<!--#include file="../inc/conn.asp"-->
<%
userid=Session("userid")
userlevel=Session("userlevel")
if userid="" or userlevel="" then
  call msgbox("请重新登陆!",0)
end if
if not isnumeric(userid) or not isnumeric(userlevel) then
  call msgbox("请重新登陆!",0)
end if
userid=CCur(userid)
userlevel=CCur(userlevel)

id=strFilter(request("id"),10)
if id="" then
  call msgbox("请正确指定修改文章!",1)
end if
if not isnumeric(id) then
  call msgbox("请正确指定修改文章!",1)
end if
if Session("categoryid")="" then
  call msgbox("","../category/class.asp")
end if
id=CCur(id)
if Session("editfilenum")="" then
  call msgbox("","../article/chg.asp?id="&id)
end if

title=strFilter(request("title"),100)
Session("title")=title

content=request("SaveContent")
content=replace(content,vbcrlf,"[BR]")
Session("content")=content

author=strFilter(request("author"),20)
Session("author")=author

source=GetWord(request("source"),100,"")
Session("source")=source

cs=GetLength(content)
if title="" then call msgbox("主题不能为空!","../article/chg.asp?id="&id)
if cs<100 then call msgbox("主题内容不能过少!","../article/chg.asp?id="&id)

action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
action = replace(action,"article/up.asp","")
content = replace(content,action,picpath)

sql="select top 1 * from article where id="&id
rs.open sql,conn,1,3
rs("filenum")	=Session("editfilenum")
rs("title")	=title
rs("content")	=content
rs("pic")	=Session("photoup")
if author><"" then
  rs("author")	=author
end if
if source><"" then
  rs("source")	=source
end if
rs("csize")	=cs
rs.update
rs.close

Session("photodata")	=""
Session("editfilenum")	=""
Session("filenum")	=""
Session("title")	=""
Session("content")	=""
Session("author")	=""
Session("source")	=""
Session("photoup")	=0

call msgbox("文章修改成功!","../article/chg.asp?id="&id)
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?