📄 bulletinsave.asp
字号:
<!--#include File="../ConnDB.asp"-->
<!--#include File="../class/Bulletin.asp"-->
<!--#include File="../class/Person.asp"-->
<!--#include file="isAdmin.asp"-->
<html>
<head>
<title>保存公告</title>
</head>
<body>
<%
Function changechr(str)
changechr = replace(str," "," ")
changechr = replace(changechr,chr(13),"<br>")
End Function
Dim StrAction
'得到动作参数,如果为add则表示创建公告,如果为update则表示更改公告
StrAction = Request.QueryString("action")
' 读取当前用户信息
set objPerson = new Person
objPerson.GetPersonInfo(Session("UserName"))
' 设置公告信息
set obj = new Bulletin
'取得公告题目和内容和提交人用户名
obj.Title = Trim(Request("title"))
obj.Content = changechr(Trim(Request("content")))
obj.Poster = objPerson.Name
obj.PostTime = Now
If StrAction="add" Then
'在数据库表Board中插入新公告信息
obj.insert
Else
'更改此公告信息
id = Request.QueryString("id")
obj.update(id)
End If
Response.Write "<h3>公告成功保存</h3>"
set objPerson = Nothing
set obj = Nothing
%>
</body>
<script language="javascript">
// 刷新父级窗口,延迟此关闭
opener.location.reload();
setTimeout("window.close()",600);
</script>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -