1 Star 3 Fork 2

strwei / strweibbs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
new.asp 1.57 KB
一键复制 编辑 原始数据 按行查看 历史
strwei 提交于 2015-08-04 07:10 . new poject
<%
'--------版权信息------------------
'本程序由Strwei免费提供
'--------官方网址:strwei.com ------------------
'--------版权信息------------------
'--------定义部份------------------
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
autor = check1(request.form("autor"))
title = check1(request.form("title"))
message = check1(request.form("message"))
mail = check2(request.form("mail"))
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))
set db = Server.CreateObject("ADODB.Connection")
connect="Driver={Microsoft Access Driver (*.mdb)}; DBQ="& server.mappath("data.asp")
db.Open connect
sql = "insert into postings (title, autor, mail, message, views, replies, datum, datum_updated, updated, connected)"
sql = sql & " values('"&title&"', '"&autor&"', '"&mail&"','"&message&"', 0, 0, '"& date & " " & time &"', '"& date & " " & time &"', '"&updated&"', 0)"
db.Execute(sql)
db.close
set db = nothing
response.redirect("index.asp")
else%>
<script language="vbscript">
msgbox "请检查填写项目是否完整!",vbInformation,"出错提示!"
window.location="vbscript:history.back"
</script>
<%end if%>
ASP
1
https://gitee.com/strwei/strweibbs.git
git@gitee.com:strwei/strweibbs.git
strwei
strweibbs
strweibbs
master

搜索帮助