<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="setup.asp"-->
<!--#include file="conn.asp"-->
<%  
If Request.Form<>"" Then
		otherpwd = HX_Replace(cstr(Trim(Request.form("otherpwd"))))
		reotherpwd = HX_Replace(cstr(Trim(Request.form("reotherpwd"))))
		if otherpwd<>"" and reotherpwd<>"" then
			if instr(request.servervariables("http_referer"),"http://"&request.servervariables("SERVER_NAME") )<1 then
				'if instr(request.servervariables("http_referer"),"http://"&request.servervariables("host") )<1 then 
				response.write "处理 URL 时服务器上出错。如果您是在用任何手段攻击服务器，那你应该庆幸，你的所有操作已经被服务器记录，我们会第一时间通知公安局与国家安全部门来调查你的IP. " 
				response.end 
			end if 
		 end if
   if  otherpwd=reotherpwd  then
        if HX_Replace(request.form("action"))="addyan" then
			txtname=HX_Replace(request.form("txtname"))
			txttitle=HX_Replace(trim(request.form("txttitle")))
			txtemail=HX_Replace(trim(request.form("txtemail")))
			txtip=request.ServerVariables("REMOTE_ADDR")
			txtarea=HX_Replace(request.form("txtarea"))
			otherpwd = HX_Replace(Trim(Request.form("otherpwd")))
			reotherpwd = HX_Replace(Trim(Request.form("reotherpwd")))
			deanno = HX_Replace(Trim(Request.form("selectdean")))
			Set rs = Server.CreateObject("ADODB.Recordset")
			rs.Open  "select * from tubook",conn,1,3
			rs.addnew 
			rs("bookname") =txtname
			rs("booktitle") =txttitle
			rs("bookemail") =txtemail
			rs("bookcon") =txtarea
			rs("bookhui") =""
			rs("txtip") =txtip    
			rs("deanno") =deanno    
			rs.Update
			rs.close
			%>
			<script language="JavaScript">
			alert ("     发送成功         "   );window.location.href="gbwrite.asp"; 
			
			</script>

<%      end if
	else %>
		<script language="JavaScript">
		alert ("         验证码错误        "   );window.history.go(-1);
		
		</script>
<%
	end if
end if

 
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=site_name%>——写留言</title>
<SCRIPT language="javascript">
<!--
  function datacheck()
{  
  	if (document.form1.txtname.value==""){
	alert("你没有填写你的真实姓名！");
	form1.txtname.focus();
	return false;
	}
  	if (document.form1.txttitle.value==""){
	alert("你没有填写留言标题！");
	form1.txttitle.focus();
	return false;
	}
  	if (document.form1.otherpwd.value==""){
	alert("请正确填写验证码");
	form1.otherpwd.focus();
	return false;
	}
  	if (document.form1.selectdean.value==""){
	alert("请选择收信领导");
	form1.selectdean.focus();
	return false;
	}
  	if (document.form1.txtarea.value==""){
	alert("请认真填写你的留言内容");
	form1.txtarea.focus();
	return false;
	}
	return true;

}

-->
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--#include file="top.asp" -->
<div id="box">
<div id="left">
  <div id="nav4">栏目导航</div>
  <div id="nav_content">
<ul class="cannel2">
<li><a href="gbwrite.asp">签写书信</a></li>
<li><a href="gindex.asp">信箱公开</a></li>
<li><a href="dean_Login.asp">领导入口</a></li>
</ul>
</div>
<div id="nav4">点击排行</div>
<div id="nav_content">
<ul>
<%
 Set rs = Server.CreateObject("ADODB.RecordSet")
rs.open "select top 6 * from news order by hit desc",conn,1,1
if rs.eof and rs.bof then
response.Write("")
else
do while not rs.eof
%>
<li>·<a href="list.asp?yiid=<%=rs("yiid")%>"><%=rs("title")%></a></li>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
 %>
</ul>
</div>
<div id="nav4">投票调查</div>
<div id="nav_content">
<script language="javascript" src="vote/votescript.asp?vid=7"></script>
</div>
</div>

<div id="right">
<div id="address">您的位置：本站首页 → 签写书信</div>

<div id="big_content">
<div id="content">
 <form id="form1" name="form1" method="post" action="gbwrite.asp" onSubmit="return datacheck();">
        <table width="100%" height="283" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#ABCC86">
          <tr>
            <td width="98" bgcolor="#FFFFFF"><div align="left">真 实 姓&nbsp;名<font class="xing">*</font></div></td>
            <td width="390" bgcolor="#FFFFFF"><div align="left">
              <input name="txtname" type="text" id="txtname" size="10" maxlength="5" />
            </div></td>
    </tr>
    <tr>
            <td bgcolor="#FFFFFF"><div align="left">信 件 主&nbsp;题<font class="xing">*</font></div></td>
            <td bgcolor="#FFFFFF"><div align="left">
              <input name="txttitle" type="text" id="txttitle" size="40" maxlength="40" />
            </div></td>
    </tr>
    <tr>
            <td bgcolor="#FFFFFF"><div align="left">你 的 E-mail</div></td>
            <td bgcolor="#FFFFFF"><div align="left">
              <input name="txtemail" type="text" id="txtemail" size="40" maxlength="50" />
            </div></td>
    </tr>
    <tr>
            <td bgcolor="#FFFFFF"><div align="left">验 证 码<font class="xing">*</font></div></td>
            <td bgcolor="#FFFFFF"><div align="left">
              <input name="otherpwd" type="text" id="otherpwd" size="6" maxlength="20" class=button1>
              <%
				dim temprnd
				Randomize
				temprnd=cstr(Int((9999 - 1000 + 1) * Rnd() + 1000))
				response.Write (temprnd)
			  %>
              <input type="hidden" name="reotherpwd" value="<%=temprnd%>">
              <input type="hidden" name="action" value="addyan">
            </div></td>
    </tr>
    <tr>
      <td bgcolor="#FFFFFF"><div align="left">选择领导<font class="xing">*</font></div></td>
      <td bgcolor="#FFFFFF"><div align="left">
        <select name="selectdean" id="selectdean">
          <option value="" selected>请选择收信领导</option>
            <% 
set rs=conn.execute("select * from deandata") 
do while not rs.eof
%>
          <option value="<%=rs("deanno")%>"><%=trim(rs("deanname"))%></option>
            <%rs.movenext     
loop  
rs.close
set rs=nothing
%>
        </select>
      </div></td>
    </tr>
    <tr>
            <td bgcolor="#FFFFFF"><div align="left">你 的 信 件<font class="xing">*</font>&nbsp; </div></td>
            <td bgcolor="#FFFFFF"><div align="left">
              <textarea name="txtarea" cols="50" rows="10" id="txtarea"></textarea>
              <br>
              *如需回复至您邮件地址请注明</div></td></tr>
    <tr>
      <td bgcolor="#FFFFFF"><div align="left"></div></td>
      <td bgcolor="#FFFFFF"><div align="left"><br>        
          <input type="submit" name="Submit" value="提交" />
          <input type="reset" name="Submit2" value="重置" />
      </div></td>
    </tr>
  </table>
</form> 
</div>
</div>
</div>
</div>
<!--#include file="bottom.asp"-->
</body>
</html>
<%conn.close
set conn=nothing%>
