⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 save.asp

📁 asp
💻 ASP
字号:
<%response.expires=0%>
<meta http-equiv="Pragma" content="no-cache">
<!--#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)

categoryid=strFilter(request("categoryid"),10)
if categoryid="" then
  call msgbox("请正确指定分类!",1)
end if
if not isnumeric(categoryid) then
  call msgbox("请正确指定分类!",1)
end if
categoryid=CCur(categoryid)

if Session("filenum")="" then
  call msgbox("请重新录入",1)
end if

sql="select top 1 categoryname,categoryindex from category where categoryid="&categoryid
rs.open sql,conn,1,1
if not rs.eof then
  cname=rs(0)
else
  rs.close
  call msgbox("该分类不存在!",1)
end if
rs.close


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

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

Session("subjectid")=""
Session("subjectname")=""
subject=strFilter(request("subject"),20)
if subject><"" then
  if isnumeric(subject) then
    sql="select top 1 categoryname from category where categoryid="&subject
    rs.open sql,conn,1,1
    if not rs.eof then
      Session("subjectid")=CCur(subject)
      Session("subjectname")=rs(0)
    end if
    rs.close
  end if
end if

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

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

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

cs=GetLength(content)
if title="" then call msgbox("主题不能为空!","../news/add.asp?categoryid="&categoryid)
if cs<100 then call msgbox("新闻内容不能过少!","../news/add.asp?categoryid="&categoryid)

action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
action = replace(action,"news/save.asp","")
content = replace(content,action,"/news/")

sql="select top 1 * from news"
rs.open sql,conn,1,3
rs.addnew
if Session("subjectid")><"" and Session("subjectid")><CCur(categoryid) then
  rs("categoryid")="."&categoryid&"."&cname&"."&Session("subjectid")&"."&Session("subjectname")&"."
else
  rs("categoryid")="."&categoryid&"."&cname&"."
end if
rs("filenum")	=Session("filenum")
rs("title")	=title
rs("content")	=content
rs("path")	=Session("filepath")
rs("pic")	=Session("photoup")
if skey><"" then
  rs("skey")	=skey
end if
if author><"" then
  rs("author")	=author
end if
if source><"" then
  rs("source")	=source
end if
rs("csize")	=cs
rs("otime")	=now
rs.update
rs.close

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


sql="select top 1 id from news order by id DESC"
rs.open sql,conn,1,1
if not rs.eof then
  id=rs(0)
end if
rs.close
%>
<!--#include file="html.asp"-->

⌨️ 快捷键说明

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