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

📄 change.asp

📁 结合了某度和AH的个人主页 功能比较完整
💻 ASP
字号:
<!--#include file="conn.asp" -->
<%
if session("admin")<>"admin" then
response.Redirect("../admin/index.asp")
response.End()
end if
%>
<%
id=Trim(Request.QueryString("id"))
sql="select * from dairy where id="&id
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" "">
<title>日记本</title>
<link href="diary.css" rel="stylesheet" type="text/css">
</head>

<body background="../img/dnacebg2.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"  >
<table width="503" border="0" align="center" cellpadding="0" cellspacing="0" background="img/bg.gif">
  <tr> 
    <td width="505" height="350" align="center" valign="top" bgcolor="#E4C59A"><br>
      <font color="#86540c">更改日记</font><br>
      <hr width="430" size="1">
      <table width="90%" border="0" cellpadding="0" cellspacing="0" bgcolor="#E4C59A">
        <form language="javascript" name="writeform" method="post" action="do.asp?action=ok&id=<%=rs("id")%>" onSubmit="return CheckForm()">
          <tr> 
            <td height="16">标题: </td>
            <td colspan="6"> <input name="title" type="text" id="title3" value="<%=rs("title")%>" size="20"></td>
          </tr>
          <tr> 
            <td height="5" valign="top">天气: </td>
            <td width="65" height="5" valign="top"> <input name="tianqi" type="radio" title="今天天气晴" value="images/1.gif" <% if rs("tianqi")="images/1.gif" then Response.Write("checked")%>> 
              <img src="images/1.gif" alt="今天天气晴" width="23" height="24" align="absmiddle"> 
            </td>
            <td width="68" valign="top"> <input title="阴啦,有云" type="radio" name="tianqi" value="images/2.gif" <% if rs("tianqi")="images/2.gif" then Response.Write("checked")%>> 
              <img src="images/2.gif" alt="阴啦,有云" width="23" height="24" align="absmiddle"></td>
            <td width="57" valign="top"> <input title="雨一直下" type="radio" name="tianqi" value="images/3.gif"  <% if rs("tianqi")="images/3.gif" then Response.Write("checked")%>> 
              <img src="images/3.gif" alt="雨一直下" width="23" height="24" align="absmiddle"></td>
            <td width="58" valign="top"> <input title="打雷咯……" type="radio" name="tianqi" value="images/4.gif" <% if rs("tianqi")="images/4.gif" then Response.Write("checked")%>> 
              <img src="images/4.gif" alt="打雷咯……" width="22" height="21" align="absmiddle"></td>
            <td width="53" valign="top"> <input title="星星在眨眼睛呢" type="radio" name="tianqi" value="images/5.gif" <% if rs("tianqi")="images/5.gif" then Response.Write("checked")%>> 
              <img src="images/5.gif" alt="星星在眨眼睛呢" width="23" height="24" align="absmiddle"> 
            </td>
            <td width="101" valign="top"> <input title="看,月亮弯弯" type="radio" name="tianqi" value="images/6.gif" <% if rs("tianqi")="images/6.gif" then Response.Write("checked")%>> 
              <img src="images/6.gif" alt="看,月亮弯弯" width="23" height="24" align="absmiddle"></td>
          </tr>
          <tr> 
            <td height="6" valign="top">心情:</td>
            <td valign="top"> <input type="radio" name="xq" value="xq/f.gif" <% if rs("xq")="xq/f.gif" then Response.Write("checked")%>> 
              <img src="xq/f.gif" width="19" height="19" align="absmiddle"> </td>
            <td valign="top"><input type="radio" name="xq" value="xq/f1.gif" <% if rs("xq")="xq/f1.gif" then Response.Write("checked")%>> 
              <img src="xq/f1.gif" width="19" height="19" align="absmiddle"> </td>
            <td valign="top"><input type="radio" name="xq" value="xq/f2.gif" <% if rs("xq")="xq/f2.gif" then Response.Write("checked")%>> 
              <img src="xq/f2.gif" width="19" height="19" align="absmiddle"></td>
            <td valign="top"><input type="radio" name="xq" value="xq/f3.gif" <% if rs("xq")="xq/f3.gif" then Response.Write("checked")%>> 
              <img src="xq/f3.gif" width="19" height="19" align="absmiddle"></td>
            <td valign="top"><input type="radio" name="xq" value="xq/f4.gif" <% if rs("xq")="xq/f4.gif" then Response.Write("checked")%>> 
              <img src="xq/f4.gif" width="19" height="19" align="absmiddle"> </td>
            <td valign="top"><input type="radio" name="xq" value="xq/f5.gif"> 
              <img src="xq/f5.gif" width="19" height="19" align="absmiddle"></td>
          </tr>
          <tr> 
            <td colspan="7"> 
              <!--#include file="getubb.asp" -->
			  <script language="JavaScript" src="code.js"></script>
            </td>
          </tr>
          <tr> 
            <td height="47" valign="top">内容: </td>
            <td height="47" colspan="6" valign="top"><textarea id="Content"  name="content" cols="50" rows="10"><%=rs("content")%></textarea></td>
          </tr>
          <tr align="center"> 
            <td  width="503" style="Word-Wrap:break-word" height="20" colspan="7" valign="top"> 
              <%dim ii
for i=1 to 28
	response.write "<img src="""&"emot/em"&i&".gif"&""" border=0 onclick=""insertsmilie('[em"&i&"]')"" style=""CURSOR: hand"">&nbsp;"
next%>
            </td>
          </tr>
          <tr> 
            <td colspan="7" align="center"><br> <input type="submit" name="Submit" value="修改"> 
              &nbsp; <input type="reset" name="Submit2" value="重新来"> </td>
          </tr>
        </form><%
			sub ok()
				dim title
				dim tianqi
				dim xq
				dim comtent
				dim dateandtime
				title=Trim(Request.Form("title"))
				tianqi=Trim(Request.Form("tianqi"))
				xq=Trim(Request.Form("xq"))
				content=request.form("content")
				dateandtime=date()
				if title="" then
				response.write"<script>alert('留言主题不能为空');</script>"
				response.End()
				elseif contetn="" then
				response.write"<script>alert('留言内容不能为空');</script>"
				response.End()
				else
				set rs=server.CreateObject("adodb.recordset")
				sql="select * from dairy where id="&id
				rs.open sql,conn,3,3
				rs("title")=title
				rs("tianqi")=tianqi
				rs("content")=content
				rs("xq")=xq
				rs("dateandtime")=dateandtime
				rs.update
				rs.close
				set rs = nothing
				response.Redirect("index.asp")
				end if
			    end sub
				%>
				 </table>
      <br>
      <br>
      <br>

    </td>
  </tr> </table> 
  </body>
</html>

⌨️ 快捷键说明

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