gusucode.com > ASP+ACCESS中学网站设计与实现(论文+源代码+开题报告+任务书) > ASP+ACCESS中学网站设计与实现(论文+源代码+开题报告+任务书)\ASP001中学网站设计与实现\zxweb\lyb\reply.asp

    <%@ language=VBScript %>
<!--#include file="setup.asp"-->
<!--#include file="inc/check.asp"-->
<%

call index()
sub index()

if Request("menu") = "replyadd" then
call replyadd()
end if

%>
<html><head><title>管理员回复</title>
<link rel="stylesheet" href="images/gbook.css">
</head>
<!--#include file="inctop.asp"--><body topmargin=0>
<div align="center"><img src="images/logo.jpg" width="759" height="110"> </div>
<table width=760 height="27" border=0 align="center" cellpadding=0 cellspacing=1 background="images/dh.gif" style="border: 1px solid #CCCCCC;">
  <tr> 
    <td width="510" height="27"> <img src="images/arrow3.gif" align=absmiddle width="29" height="11"> 
      您的位置: <a href="../index.htm">铁富高级中学</a>>> 
      <a href=index.asp>留言本首页</a> >> <a href=index.asp>浏览留言</a> >>回复留言</td>
    <td width="245"><DIV align=center>【<a href="index.asp">查看留言</a>】  【<a href="write.asp">签写留言</a>】</DIV></td>
  </tr>
</table>
<br>
<script language="JavaScript1.2">
<!--
clckcnt = 0;
var postmaxchars = <%=bodymax%>;
function clckcntr(eventobject){if(event.ctrlKey && window.event.keyCode==13){clckcnt++;if (clckcnt>1) 
{alert('回复正在发出,请耐心等待!');return false;}document.reply.Submit.disabled = true; this.document.reply.submit();}}
function validate(theform) {
	if (theform.password.value=="" || theform.reply.value=="") {
		alert("管理口令和回复内容是必须填写的!");
		clckcnt=0;
		return false; }
	if (postmaxchars != 0) {
		if (theform.reply.value.length > <%=bodymax%>) {
			alert("你的信息太长了.\n\n请限制在 "+<%=bodymax%>+" 字节以内.\n当前已有 "+theform.reply.value.length+" 字节.");
			clckcnt=0;
			return false; }
		else { document.reply.Submit.disabled = true; return true; }
	} else { 
document.reply.Submit.disabled = true; return true; }
}
-->
</script>
<table width="760" border="0" align="center" cellpadding="4" cellspacing="1" bordercolor="#fffff0" bgcolor="#99CCFF">
  <tr> 
    <td height="210" align="center" valign="middle" bordercolor="#99CCFF" bgcolor="#fffff0"> 
      <form name=reply method="post" action="reply.asp" onSubmit="return validate(this)">
	<input type=hidden name=menu value=replyadd>
	<input type=hidden name=replyid value=<%=request("replyid")%>>
        <table width="86%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
          
        <tr> 
          <td width="17%" align="center" nowrap bordercolor="#99CCFF" bgcolor="#fffff0">管理口令:</td>
            
          <td width="83%" nowrap bgcolor="#fffff0"> 
            <input type="password" name="password" size="20" style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#F7FBFF'" onMouseOut = "this.style.backgroundColor = ''" value=<%=Request.cookies("password")%>> <input type=checkbox name=save value=save <%if Request.cookies("save") <> "" then%>checked<%end if%>>记住密码
            </td>
          </tr>
          
        <tr> 
          <td align="center" nowrap bordercolor="#99CCFF" bgcolor="#fffff0">回复内容:</td>
            
          <td nowrap bgcolor="#fffff0"> 
            <textarea name="reply" cols="60" rows="6" wrap=hard style="background-color:#ffffff; color:#8888AA; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#F7FBFF'" onMouseOut = "this.style.backgroundColor = ''" onkeydown=clckcntr()></textarea>
            </td>
          </tr>
          
        <tr bgcolor="#fffff0"> 
          <td colspan="2" align="center" nowrap bordercolor="#99CCFF" bgcolor="#fffff0"> 
            <input type="submit" name="Submit" value="回 复" style="backgroud-color: #ffffff; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; FONT-FAMILY: 宋体; FONT-SIZE: 9pt; HEIGHT: 18px; WIDTH: 50px">
              <input type="reset" name="Submit2" value="重 置" style="backgroud-color: #ffffff; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; FONT-FAMILY: 宋体; FONT-SIZE: 9pt; HEIGHT: 18px; WIDTH: 50px">
              <input type="button" name="Submit3" value="取 消" Onclick="javascript:history.back(-1);" style="backgroud-color: #ffffff; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-top: 1px solid; FONT-FAMILY: 宋体; FONT-SIZE: 9pt; HEIGHT: 18px; WIDTH: 50px">
              </td>
          </tr></form>
        </table>
      
    </td>
  </tr>
</table>
<br>
<table width=760 height="22" border=0 align="center" cellpadding=0 cellspacing=1 background="images/dh.gif" style="border: 1px solid #CCCCCC;">
  <tr> 
    <td width="510" height="18">&nbsp;</td>
    <td width="245">&nbsp;</td>
  </tr>
</table>
<%
call htmlend()

Response.End
end sub

sub replyadd()
dim password,reply,replyid

password = Request.form("password")
reply = htmlencode2(trim(Request.form("reply")))
replyid = Request.form("replyid")
save = Request.form("save")

if replyid = "" then
message=message&"对不起,你的回复ID号不能为空!\n"
end if

sql = "select * from gbook where id="&replyid
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open sql,conn,1,1

if Rs.eof and Rs.bof then
message=message&"对不起,你的回复ID号不存在!\n"
end if
Rs.close

if password <> passwords then
message=message&"您的管理口令不正确!\n"
end if

if reply = "" then
message=message&"回复内容不能为空!\n"
end if

if reply <>"" and len(reply)> bodymax then
message=message&"对不起,回复字数不能超过 "&bodymax&" 字,谢谢!\n"
end if

	if message <> "" then
	call error(""&message&"")
	Response.end

	else

	if save <> "" then
	Response.cookies("password") = password
	Response.cookies("save") = save
	else
	Response.cookies("password") = ""
	Response.cookies("save") = ""
	end if

sql = "select * from reply"
Rs.open sql,conn,3,2
Rs.addnew
Rs("reply")=reply
Rs("replytime")=now
Rs("replyid")=replyid
Rs.update
Rs.close
conn.close
set Rs = nothing
set conn = nothing
Response.redirect "index.asp"
Response.End

	end if
end sub
%>