📄 write.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%
IF POPWrite<>"True" Then
IF Session("PROADMIN")<>"True" Then
Response.Redirect "Login.asp"
Response.End
End IF
End IF
function HTMLcode(fString)
if not isnull(fString) then
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
HTMLcode = fString
end if
end function
dim week,week1
week=weekday(date())
week1=week-1
if week1="0" then
week1="日"
end if
if week1="1" then
week1="一"
end if
if week1="2" then
week1="二"
end if
if week1="3" then
week1="三"
end if
if week1="4" then
week1="四"
end if
if week1="5" then
week1="五"
end if
if week1="6" then
week1="六"
end if
IF Request("POST")<>"" Then
Call WriteData
End IF
Function WriteData
IF Request("content")="" or Request("content")="请填写日记内容" Then
Response.Write "<font color=red>请填写日记内容</font> <a href=write.asp>返回</a>"
response.end
Else
Set Rs = Server.CreateObject("ADODB.Recordset")
Sql = "Select * From diary"
Rs.Open Sql,conn,1,3
Rs.AddNew
Rs("title")=Request("title")
Rs("content")=Request("content")
Rs("weather")=Request("weather")
Rs("date")=year(now)&"-"&month(now)&"-"&day(now)&"-星期"&week1
Rs.Update
Rs.Close
Set Rs=Nothing
Call CloseDB
Response.Redirect "Default.asp"
End IF
End Function
%>
<html>
<head>
<title>签写日记</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<br><br><br>
<form name="form1" method="post" action="">
<input type="hidden" name="POST" value="True">
<table width="477" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td colspan="2">日期:<%=year(now)&"-"&month(now)&"-"&day(now)%> 星期<%=week1%> 标题:工作日记
<input name="title" type="hidden" size="20" value="工作日记">
天气<font color="#FFFFFF">:
<select name="weather">
<option value="怪天气">怪天气</option>
<option value="<img src=images/1.gif border=0>">晴天</option>
<option value="<img src=images/2.gif border=0>">阴天</option>
<option value="<img src=images/3.gif border=0>">小雨</option>
<option value="<img src=images/4.gif border=0>">电闪雷鸣</option>
<option value="<img src=images/6.gif border=0>">月儿弯弯</option>
<option value="<img src=images/5.gif border=0>">星星闪烁</option>
</select>
</font> [<a href=Default.asp>返回首页</a>]</td>
</tr>
<tr>
<td width="384">
<textarea name="content" cols="70" rows="9"></textarea>
</td>
<td width="86"> </td>
</tr>
<tr>
<td colspan="2">
<input style="border:1pt dotted green;background-color:#ffffff;width=60px" type="submit" value="写 好 了">
<input style="border:1pt dotted green;background-color:#ffffff;width=60px" type="reset" value="重 新 写" name="重置">
</td>
</tr>
</table>
</form>
<br><br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -