📄 boardsave.asp
字号:
<!--#include File="../ConnDB.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")
'取得公告题目和内容和提交人用户名
title = Trim(Request("title"))
content = changechr(Trim(Request("content")))
poster = Session("admin_id")
If StrAction="add" Then
'在数据库表Board中插入新公告信息
sql = "Insert into Board(title,content,posttime,poster) Values('"&title&"','"&content&"','"&now&"','"&poster&"')"
Else
'更改此公告信息
id = Request.QueryString("id")
sql = "Update Board Set title='"&title&"',content='"&content&"',posttime='"&now&"',poster='"&poster&"' where id="&id
End If
'response.write sql
'执行数据库操作
Conn.Execute(sql)
Response.Write "<h3>公告成功保存</h3>"
%>
</body>
<script language="javascript">
// 刷新父级窗口,延迟此关闭
opener.location.reload();
setTimeout("window.close()",600);
</script>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -