📄 save_diary.asp
字号:
<!--#include file="conn.asp"-->
<%
'=========================================================
' 随然日记本(多用户版) Version:3.0
' Date: 2004-11-15
' Script Written by 随然(dampure)
' 随然日记本演示地址:http://www.suiran.cn
'=========================================================
' Copyright (C) 2003,2004 真露无香. All rights reserved.
' Web: www.yongzi.com
' Diary:http://www.suiran.cn
'=========================================================
title=trim(request.form("title"))
weather=request.form("weather")
if_public=request.form("if_public")
content=request.form("content")
nowtime=now()
week=weekday(now())
if title="" then
title=left(content,12)&"......"
end if
if session("userid")="" then
%>
<script language=vbscript>
MsgBox "呵呵~~~!你不是管理员吧!不要乱来噢~~~!"
location.href = "javascript:history.back()"
</script>
<%
elseif content="" then
%>
<script language=vbscript>
MsgBox "错误:请填写完整后再提交!"
location.href = "javascript:history.back()"
</script>
<%
else
if request("act")="add" then
set rs=server.createobject("ADODB.recordset")
rs.Open "SELECT * FROM diary Where id is null",conn,1,3
rs.addnew
rs("title")=title
rs("content")=content
rs("userid")=session("userid")
rs("weather")=weather
rs("lock")=if_public
rs("readpass")=""
rs("date")=nowtime
rs("week")=week
rs("hits")=1
rs.update
rs.close
elseif request("act")="modify" then
set rs=server.createobject("ADODB.recordset")
rs.Open "SELECT * FROM diary Where id="&request("id"),conn,1,3
rs("title")=title
rs("content")=content
rs("weather")=weather
rs("lock")=if_public
rs.update
rs.close
end if
%>
<script language=vbscript>
MsgBox "操作成功,请点击返回日记本首页!"
location.href = "diary.asp?user=<%=session("username")%>"
</script>
<%
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -