📄 new.asp
字号:
<!--#include file="../config/sys.asp" -->
<%save = true
function zweistellig(wert)
if len(wert)<2 then wert = "0" & wert
zweistellig = wert
end function
function check1(wert)
if len(wert)<1 then save = false
wert = replace(wert,"'", "`")
wert = replace(wert,chr(34), "``")
check1 = wert
end function
function check2(wert)
if len(wert)<1 then wert = " "
wert = replace(wert,"'", "`")
wert = replace(wert,chr(34), "``")
check2 = wert
end function
CheckCode=replace(Request("CheckCode"),"'","")
if session("CheckCode")="" then
response.write"<SCRIPT language=JavaScript>alert('你页面停留时间过长,请重新登陆!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.End
end if
if CheckCode<>CStr(session("CheckCode")) then
response.write"<SCRIPT language=JavaScript>alert('你输入的验证码不正确,请重新输入!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.End
end if
if session("keeptime")="" then
session("keeptime")=now
else if (dateDiff("s",session("keeptime"),now)<=seconds and ((session("admin")<>1) and (session("admin")<>2))) then
response.Redirect("../error.asp?msg=你的发言过快!")
else session("keeptime")=now
end if
end if
autor = check1(request.form("autor"))
title = check1(request.form("title"))
message = check1(request.form("message"))
if killword<>"" then
arrayx=Split(killword,",")
for i=0 to ubound(arrayx)
title =replace(title ,arrayx(i),"***")
message=replace(message,arrayx(i),"***")
next
end if
flog= check2(request.form("helpflog"))
todaybbs= check2(request.form("todaybbs"))
if todaybbs<>"1" then todaybbs="0"
addip=Request.ServerVariables("REMOTE_ADDR")
IF FLOG<>"1" THEN FLOG="0"
if save = true then
updated = zweistellig(right(year(date),2)) & zweistellig(month(date)) & zweistellig(day(date)) & zweistellig(hour(time)) & zweistellig(minute(time)) & zweistellig(second(time))
sql = "insert into postings (title, autor, message, views, replies, datum, datum_updated, updated, connected,addip,helpflog,todaybbs)"
sql = sql & " values('"&title&"', '"&autor&"','"&message&"', 0, 0, '"& date & " " & time &"', '"& date & " " & time &"', '"&updated&"', 0,'"&addip&"','"&flog&"','"&todaybbs&"')"
conn.Execute(sql)
CONN.close
set CONN = nothing
response.redirect("bbs.asp")
else%>
<script language="vbscript">
msgbox "请检查填写项目是否完整!",vbInformation,"出错提示!"
window.location="vbscript:history.back"
</script>
<%end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -