?? boardsave.asp
字號:
<!--#include File="../ConnDB.asp"-->
<!--#include file="isAdmin.asp"-->
<html>
<head>
<title>網(wǎng)上商城公告</title>
</head>
<body>
<%
Function changechr(str)
changechr = replace(str," "," ")
changechr = replace(changechr,chr(13),"<br>")
End Function
Dim StrAction
'得到動作參數(shù),如果為add則表示創(chuàng)建公告,如果為update則表示更改公告
StrAction = Request.QueryString("action")
'取得公告題目和內(nèi)容和提交人用戶名
title = Trim(Request("title"))
content = changechr(Trim(Request("content")))
poster = Session("admin_id")
If StrAction="add" Then
'在數(shù)據(jù)庫表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
'執(zhí)行數(shù)據(jù)庫操作
Conn.Execute(sql)
Response.Write "<h3>公告成功保存</h3>"
%>
</body>
<script language="javascript">
// 刷新父級窗口,延遲此關(guān)閉
opener.location.reload();
setTimeout("window.close()",600);
</script>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -