📄 savearticle.asp
字号:
<!--#include file="connbbs.asp"-->
<% if session("user")="" then
response.redirect "../err.asp"
end if
bbsid=trim(request("bbsid"))
bbsid=replace(bbsid,"'","")
user=session("user")
title=trim(request("title"))
title=replace(title,"'","")
if title="" then%>
<script language=vbscript>
MsgBox "对不起,标题不能为空!"
location.href = "javascript:history.back()"
</script>
<%end if
expression=trim(request("Expression"))
titleimg="images/"&expression&".gif"
rootid=trim(request("rootid"))
rootid=replace(rootid,"'","")
if not isnumeric(rootid) then
response.redirect "../err.asp"
end if
if not isnumeric(bbsid) then
response.redirect "../err.asp"
end if
contents=trim(request("body"))
contents=replace(contents,"'","")
if request("signflag")="yes" then
signflag=1
else signflag=0
end if
if request("emailflag")="yes" then
emailflag=1
else emailflag=0
end if
lasttime=year(now())&"-"&month(now())&"-"&day(now())&" "&hour(now())&":"&minute(now())&":"&second(now())
set rs=server.createobject("ADODB.recordset")
sql="select * from bbslist where id="&trim(bbsid)&" order by id desc"
rs.open sql,conn,1,1
if rs.bof and rs.eof then%>
<script language=vbscript>
MsgBox "对不起,找不到这个论坛!"
location.href = "javascript:history.back()"
</script>
<%else
conn.execute"insert into bbs(bbsid,user,titleimg,title,contents,lasttime,lastpostuser,rootid,hits,replycount,best,locktitle,signflag,emailflag) values("&bbsid&",'"&user&"','"&titleimg&"','"&title&"','"&contents&"',#"&lasttime&"#,'"&lastpostuser&"',"&rootid&",0,0,0,0,"&signflag&","&emailflag&")"
if rootid<>0 then
conn.execute"update bbs set lastpostuser='"&user&"',replycount=replycount+1,lasttime=#"&lasttime&"# where id="&rootid
end if
conn.execute "update user set bbscount=bbscount+1,usermoney=usermoney+2 where user='"&session("user")&"'"
end if
rs.close
conn.close
set conn=nothing
response.redirect "main.asp?bbsid="&bbsid
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -