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

📄 guest_edit.asp

📁 留言薄系统
💻 ASP
字号:
<!--#INCLUDE FILE="config.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>编辑留言</title>
<link href="1.css" rel="stylesheet" type="text/css">
</head>
<body onkeydown="if(event.keyCode==13 && event.ctrlKey) if(save_onclick1())document.form.submit()">
<table border=0 width=700 align=center>
  <tr> 
    <td align=center> 
      <!--#INCLUDE FILE="top.asp"-->
  </tr>
  <tr> 
    <td align=center><hr size=1 width=100% noshade color=#C0C0C0></tr>
</table>
  <SCRIPT language=javascript>
function  save_onclick()
{
  document.form.Content.value=editor.HtmlEdit.document.body.innerHTML;
  var strTemp = document.form.password.value;
  if (strTemp.length == 0 )
  {
      alert("请填写密码");
      document.form.password.focus();
      return false;
  }
  var strTemp = document.form.Content.value;
  if (strTemp.length == 0 )
  {
      alert("请填写留言内容");
      return false;
  }
  return true;  
}
function  save_onclick1()
{
  var strTemp = document.form.password.value;
  if (strTemp.length == 0 )
  {
      alert("请填写密码");
      document.form.password.focus();
      return false;
  }
  var strTemp = document.form.Content.value;
  if (strTemp.length == 0 )
  {
      alert("请填写留言内容");
      return false;
  }
  return true;  
}
</SCRIPT>
</p>
<% Set rs=server.createobject("ADODB.RECORDSET")
   rs.open "Select * From guest where id="&request("id"),Conn,2,3
   if session("useridname")<>rs("username") then if session("admin")<>1 then if session("admin")<>2 then response.Redirect "error.asp?info=非作者本人不能修改!"
Set rs1=server.createobject("ADODB.RECORDSET")
rs1.open "Select * From option1" ,Conn,1,1
if request.Form<>"" then
rs.close
	 password=request.Form("password")
	 pic=request.Form("pic")
     Subject       =Request.Form("Subject")
     content       =Request.Form("content")
	 username=request.Form("username")
	 id=request.Form("id")
	 secret=request.Form("secret")
	 if secret<>1 then secret=0
		content=replace(content,vbCrLf,"<br>")
		content=replace(content," ","&nbsp;")
	 rs1.close
	 set rs1=nothing
     lydate =now
	 if homepage="http://" then homepage="" 

      Set rs=server.createobject("ADODB.RECORDSET")
	  rs.open "Select * From register where username='" & username& "'" ,Conn,2,3  
	 if session("admin")<>1 then if session("admin")<>2 then if md5(password)<>rs("password") then response.Redirect "error.asp?info=用户名或密码错误!"
      rs.close
	  rs.open "Select * From guest where id=" & id,Conn,2,3
		rs("subject")=subject
	 content=replace(content,"'","""")
		rs("content")=content
		rs("lydate")=lydate
		rs("pic")=pic
		rs("secret")=secret
    	rs.update
    	rs.close
		
     response.Redirect "guest_edit_post_ok.asp?id="&id
set rs=nothing
conn.close
set conn=nothing
end if
	recontent=rs("content")
	recontent=replace(recontent,"<br>",vbCrLf)
	recontent=replace(recontent,"&nbsp;"," ")
	recontent=replace(recontent,"""","'")
%>
<table border=0 width=100% align=center>
  <tr>
    <td width="3%" align=lift><font color="#FF0000">&nbsp;</font></td>
    <td width="8%" align=lift><a href="<%if session("list")=0 then%>default.asp<%else%>default1.asp<%end if%>">留言首页</a></td>
    <td width="89%" align=right>
      <!--#INCLUDE FILE="link.asp"-->
    </td>
</table>
<form action="" method="POST" name="form" id="form"  onsubmit="return save_onclick1()">
  <input type="hidden" name="form" value="SaveData">
  <input type="hidden" name="D_Date" value="<%=cstr(now())%>">
  <div align="center">
  <table width="100%" border="1" cellpadding="5" cellspacing="1" bgcolor="#E6F2FF" style="border-collapse: collapse" bordercolor="#000000" >
    <tr >
      <td colspan="2" bordercolorlight="#000000" bordercolordark="#C0C0C0">
        <p align="center"><strong style="font-weight: 400">编辑留言</strong></td>
    </tr>
    <tr class="table001">
      <td width="206" align="center"><div align="left">
		<strong style="font-weight: 400">用户名:</strong></div></td>
      <td width="743" height="28" align="center"><div align="left"> <%=rs("username")%> </div></td>
    </tr>
    <tr class="table001">
      <td width="206" align="center"><div align="left">
		<strong style="font-weight: 400">密码:</strong></div></td>
      <td height="28" align="center"><div align="left">
          <input name="password" type="password" class="input1" id="password2" value="<%=session("useridpassword")%>" size="15">
(必填,否则不能修改)</div></td>
    </tr>
    <tr class="table001">
      <td width="206" align="center"><div align="left">
		<strong style="font-weight: 400">心情:</strong></div></td>
      <td height="28" align="center"><div align="left">
          <table border="0" width="48%" cellspacing="1" cellpadding="0">
            <tr>
              <td align="center">
                <input name="pic" type="radio" value="p1.gif" <%if rs("pic")="p1.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p1.gif"></td>
              <td align="center">
                <input type="radio" value="p2.gif" name="pic" <%if rs("pic")="p2.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p2.gif"></td>
              <td align="center">
                <input type="radio" value="p3.gif" name="pic" <%if rs("pic")="p3.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p3.gif"></td>
              <td align="center">
                <input type="radio" value="p4.gif" name="pic" <%if rs("pic")="p4.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p4.gif" ></td>
              <td>
                <input type="radio" value="p5.gif" name="pic" <%if rs("pic")="p5.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p5.gif"></td>
              <td>
                <input type="radio" value="p6.gif" name="pic" <%if rs("pic")="p6.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p6.gif"></td>
              <td>
                <input type="radio" value="p7.gif" name="pic" <%if rs("pic")="p7.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p7.gif"></td>
              <td>
                <input type="radio" value="p8.gif" name="pic" <%if rs("pic")="p8.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p8.gif"></td>
              <td>
                <input type="radio" value="p9.gif" name="pic" <%if rs("pic")="p9.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p9.gif" width="15" height="15"></td>
            </tr>
            <tr>
              <td align="center">
                <input type="radio" value="p10.gif" name="pic" <%if rs("pic")="p10.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p10.gif" width="15" height="22"></td>
              <td align="center">
                <input type="radio" value="p11.gif" name="pic" <%if rs("pic")="p11.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p11.gif" width="15" height="15"></td>
              <td align="center">
                <input type="radio" value="p12.gif" name="pic" <%if rs("pic")="p12.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p12.gif" width="15" height="15"></td>
              <td align="center">
                <input type="radio" value="p13.gif" name="pic" <%if rs("pic")="p13.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p13.gif" width="15" height="15"></td>
              <td>
                <input type="radio" value="p14.gif" name="pic" <%if rs("pic")="p14.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p14.gif" width="15" height="15"></td>
              <td>
                <input type="radio" value="p15.gif" name="pic" <%if rs("pic")="p15.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p15.gif" width="15" height="15"></td>
              <td>
                <input type="radio" value="p16.gif" name="pic" <%if rs("pic")="p16.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p16.gif" width="15" height="15"></td>
              <td>
                <input type="radio" value="p17.gif" name="pic" <%if rs("pic")="p17.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p17.gif" width="15" height="15" ></td>
              <td>
                <input type="radio" value="p18.gif" name="pic" <%if rs("pic")="p18.gif" then%>checked<%end if%>>
              </td>
              <td><img border="0" src="images/p18.gif" width="15" height="15" ></td>
            </tr>
          </table>
      </div></td>
    </tr>
    <tr class="table001">
      <td align="center"><div align="left"><strong style="font-weight: 400">留言标题:</strong></div></td>
      <td height="28" align="center"><div align="left"><font color="#00FF00">
        <input name="subject" type="text" class="input1" id="subject2" value="<%=rs("subject")%>" size="50" >
        <input name="username" type="hidden" id="username" value="<%=rs("username")%>">
        <input name="id" type="hidden" id="id2" value="<%=request("id")%>">
      </font></div></td>
    </tr>
    <tr class="table001">
      <td width="206" align="center"><div align="left">
		<strong style="font-weight: 400">留言内容:<br>
        </strong></div></td>
      <td height="28" align="center"><div align="left">
	  <textarea name="Content" cols="60" rows="5" id="Content"><%=recontent%></textarea>     
	  </div></td>
    </tr>
    <tr class="table001">
      <td width="206" align="center"><div align="left">
		<strong style="font-weight: 400">留言功能:</strong></div></td>
      <td height="28" align="center"><div align="left">
          <input name="secret" type="checkbox" id="secret3" value="1" <%if rs("secret") then%>checked<%end if%>>
悄悄话(只有<strong>登录</strong>后才可看到自己的留言及回复的内容)</div></td>
    </tr>
    <tr class="table001">
      <td height="28" colspan="2" align="center"> 
        <input name="join" type="submit" class="input2" id="join3" value=" 提 交 " >
 
<input name="B12" type="reset" class="input2" id="B123"  value=" 重 写 "  >&nbsp;   </td>
    </tr>
  </table>
  </div>
  <table border=0 width=700 align=center>
    <tr> 
      <td height=12><HR SIZE=1 WIDTH=100% NOSHADE COLOR=#C0C0C0></td>
    </tr>
    <tr> 
      <td align=center> 
        <!--#INCLUDE FILE="bottom.asp"-->
    </tr>
  </table>
  <p> </p>
</form>
</body>
</html>
<%
set rs=nothing
%>

⌨️ 快捷键说明

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