📄 noteadd.asp
字号:
<!-- #include file="config.inc" -->
<%
set conn=server.createobject("adodb.connection")
conn.open connstring
set objnoters=server.createobject("adodb.recordset")
set objnoters2=server.createobject("adodb.recordset")
ssql="select max(noteid) as maxid from notebook"
ssql2="select * from notebook"
userid=trim(request.form("userid"))
email=trim(request.form("email"))
content=trim(request.form("content"))
subject=trim(left(request.form("subject"),17))
application.lock
objnoters.open ssql,conn,1,3
if objnoters.eof or isnull(objnoters("maxid")) then
noteid="n00001"
else
temp=left(objnoters("maxid"),6)
temp=right(temp,5)
temp=cint(temp) ' 取得当前数据表中编号最大的原文留言
temp=cstr(temp+1)
for length=1 to 5-len(temp) ' 留言的编码位数是5位
temp="0"&temp
next
noteid="n"&temp ' 完成对这次留言序号的计算
end if
notetime=now() ' 取得当前时间作为留言时间
' 插入数据库
insertstr="insert into notebook values('"& noteid &"','"& subject &"','"& userid &"','"& notetime &"','"& content &"',0,'"& email &"',0);"
objnoters2.open insertstr,conn,1,3
application.unlock
' 关闭这次数据库连接
objnoters.close
set objnoters=nothing
conn.close
set conn=nothing
%>
<html>
<head><title>留言成功</title></head><body>
<font style="font:10pt" color=#9900CC>留言成功,请
<a href="vbscript:window.close()">点击关闭!</a></font>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -