⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 write.asp

📁 心情日记 功能: 1、 在线添加日记 2、 在线删除日记 3、 自行设定每页显示日记数 4、 自行设定日记是否公开 5、 自行设定是否不登陆就可以签写日记 6、 支持HTML代码
💻 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

IF Request("POST")<>"" Then
Call WriteData
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

Function WriteData
IF Request("content")="" or Request("content")="请在这里填写日记内容!" Then
 Response.Redirect "write.asp"
Else
Set Rs = Server.CreateObject("ADODB.Recordset")
Sql = "Select * From diary"
Rs.Open Sql,conn,1,3
Rs.AddNew

Rs("content")=HTMLcode(Request("content"))
Rs("weather")=Request("weather")
spic=Request("pic")
Rs("year")=year(now)
Rs("month")=month(now)
Rs("day")=day(now)
Rs("face") ="images/xq/"&spic&".gif"
Rs.Update
Rs.Close
Set Rs=Nothing
Call CloseDB
Response.Redirect "logout.asp"
End IF
End Function
%>
<html>
<head>
<title>签写日记</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
BODY {
	scrollbar-track-color:#ffffff;
	SCROLLBAR-FACE-COLOR: #ffffff;
	FONT-SIZE: 9pt;
	SCROLLBAR-HIGHLIGHT-COLOR: #999999;
	SCROLLBAR-SHADOW-COLOR: #000000;
	SCROLLBAR-3DLIGHT-COLOR: #ffffff;
	SCROLLBAR-ARROW-COLOR: #999999;
	FONT-FAMILY: "Verdana";
	SCROLLBAR-DARKSHADOW-COLOR: #ffffff;
	background-image: url(images/bg.gif);
	background-position:center;
	margin-bottom: 0px;
}
A {COLOR: #333333; TEXT-DECORATION: none}
A:visited {COLOR: #ff0000; TEXT-DECORATION: none}
A:active {COLOR: #ff0000; TEXT-DECORATION: none}
A:hover {COLOR: #ff0000; text-decoration: line-through;}
td {FONT-SIZE: 9pt;  FONT-FAMILY: "Verdana"; color:#333333;letter-spacing : 1pt ;line-height :14pt}
input{background-color:#ffffff;font-family:verdana;font-size:9pt}
textarea{border:1px solid #999999;background-color:#ffffff;font-family:verdana;font-size:9pt}
.style1 {color: #404040}
.style2 {color: #000000}
</style>
</head>

<body bgcolor="ffffff" text="#000000" leftmargin="0" topmargin="0">
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><img src="images/top.gif" width="770" height="210"></td>
  </tr>
</table><br><br>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
      <td colspan="2"><div align="center">签写日记     <a href="login1.asp">查看日记</a>     <a href="logout.asp">退出管理</a></div></td>
    </tr>
</table>
<br>
<form name="form1" method="post" action="">
<input type="hidden" name="POST" value="True">
  <table width="500" border="1" align="center" cellpadding="9" cellspacing="3" bordercolor="#999999" style="border-collapse: collapse">
    
    <tr> 
      <td width="370">今日天气:
        <select name="weather">
          <option value="">不知道</option>
          <option value="晴朗" selected>晴朗</option>
          <option value="阴天">阴天</option>
          <option value="多云">多云</option>
          <option value="小雨">小雨</option>
          <option value="中雨">中雨</option>
          <option value="大雨">大雨</option>
          <option value="暴雨">暴雨</option>
          <option value="小雪">小雪</option>
          <option value="中雪">中雪</option>
          <option value="大雪">大雪</option>
      </select> 
            <%=year(now)&"年"&month(now)&"月"&day(now)&"日"%></td>
      <td width="120"><div align="center">
        <script language="JavaScript" type="text/JavaScript">
<!--
var enabled = 0; today = new Date();
var day; var date;
if(today.getDay()==0) day = "星期日"
if(today.getDay()==1) day = "星期一"
if(today.getDay()==2) day = "星期二"
if(today.getDay()==3) day = "星期三"
if(today.getDay()==4) day = "星期四"
if(today.getDay()==5) day = "星期五"
if(today.getDay()==6) day = "星期六"
date = day +"";
document.write(date);// -->
      </script>
      </div></td>
    </tr>
	<tr><td windth="80" colspan="2">心情:
	<input type="radio" name="pic" value="1" checked>
	<img src="images/xq/1.gif" width="20" height="20">	<input type="radio" name="pic" value="2">
	<img src="images/xq/2.gif" width="20" height="20">	<input type="radio" name="pic" value="3"> 
	<img src="images/xq/3.gif" width="20" height="20">
	<input type="radio" name="pic" value="4">
	<img src="images/xq/4.gif" width="20" height="20">	<input type="radio" name="pic" value="5">
	<img src="images/xq/5.gif" width="20" height="20">	<input type="radio" name="pic" value="6">
	<img src="images/xq/6.gif" width="20" height="20">	<input type="radio" name="pic" value="7">
	<img src="images/xq/7.gif" width="20" height="18">	<br> 
	  <input type="radio" name="pic" value="8">
	<img src="images/xq/8.gif" width="20" height="20">	<input type="radio" name="pic" value="9">
	<img src="images/xq/9.gif" width="20" height="20">
	<input type="radio" name="pic" value="10">
	<img src="images/xq/10.gif" width="20" height="20">	<input type="radio" name="pic" value="11">
	<img src="images/xq/11.gif" width="20" height="20">
	<input type="radio" name="pic" value="12">
	<img src="images/xq/12.gif" width="20" height="20">	<input type="radio" name="pic" value="13">
	<img src="images/xq/13.gif" width="20" height="20">	<input type="radio" name="pic" value="14">
	<img src="images/xq/14.gif" width="20" height="20"></td>
	</tr>
    <tr align="center"> 
      <td colspan="2"> 
        <textarea name="content" rows="15" cols="80" style="background-color: #C0C0C0">请在这里填写日记内容!</textarea>
      </td>
    </tr>
    <tr align="center"> 
      <td colspan="2"> 
        <input type="submit" value="确定">
        &nbsp;&nbsp;&nbsp;&nbsp; 
        <input type="reset" value="重写" name="重置">
      </td>
    </tr>
    <tr align="center">    </tr>
  </table>
</form>
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td scope="col"><img src="images/top01.gif" width="770" height="164"></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -