<!--#include file="conn.asp"-->
<!--#include file="ConnUser.asp"-->
<!--#include file="config.asp"-->
<!--#include file="char.inc"-->
<!--#include file="md5.asp"-->
<!--#include file="ChkURL.asp"-->

<%
LeadMailID=ChkRequest(request("LeadMailID"),1)	'防注入
Content_Type=checkstr(request.form("Content_Type"))
YourName=checkstr(request.form("YourName"))
Email=checkstr(request.form("Email"))
TelePhone=checkstr(request.form("TelePhone"))
Address=checkstr(request.form("Address"))
Zip=checkstr(request.form("Zip"))
Topic=checkstr(request.form("Topic"))
content=trim(htmlencode1((request.form("content"))))
content=replace(content,"<p> ","")
content=replace(content,"<P> ","")
ClassID=request.form("ClassID")
E_PassWord=checkstr(request.form("E_PassWord"))
LeadMailIP=checkstr(Request.serverVariables("REMOTE_ADDR"))
Response.cookies(echsys)("content")=content

Function gen_key(digits) 
'Create and define array 
dim char_array(50) 
char_array(0) = "0" 
char_array(1) = "1" 
char_array(2) = "2" 
char_array(3) = "3" 
char_array(4) = "4" 
char_array(5) = "5" 
char_array(6) = "6" 
char_array(7) = "7" 
char_array(8) = "8" 
char_array(9) = "9" 
'Initiate randomize method for default seeding 
randomize 
'Loop through and create the output based on the the variable passed to 
'the function for the length of the key. 
do while len(output) < digits 
num = char_array(Int((9 - 0 + 1) * Rnd + 0)) 
output = output + num 
loop 
'Set return 
gen_key = output 
End Function 

dim byte1
byte1=split(byteType,"|")

for i=0 to ubound(byte1)
	content=replace(content,trim(byte1(i)),"***")
next

dim byte2
byte2=split(byteipType,"|")

for i=0 to ubound(byte2)
if Request.serverVariables("REMOTE_ADDR")=byte2(i) then
	Show_Err("对不起，你的IP地址已被锁定，请联系管理员！！！。<br><br><a href='javascript:history.back()'>返回</a>")
	Response.cookies(echsys)("content")=""
	Response.End 
end if
next

dim byte3
byte3=split(bytezfType,"|")

for i=0 to ubound(byte3)
if Instr(request("content"),byte3(i))>0  then
	Show_Err("对不起，请不要发布非法小广告！！！。<br><br><a href='javascript:history.back()'>返回</a>")
	Response.cookies(echsys)("content")=""
	Response.End 
end if
next

if Instr(request("content"),"'")>0 or Instr(request("content"),"script")>0 or Instr(request("content"),"onClick")>0  or Instr(request("content"),"onload")>0 then
	Show_Err("对不起，您输入的信息内容包含有非法字符。<br><br><a href='javascript:history.back()'>返回</a>")
	Response.End 
end if


if LeadMailID="" then
	set rs=server.createobject("adodb.recordset")
	sql="select * from "& db_wygkcn_LeadMail_Table &"" 
	rs.open sql,conn,1,3
	rs.addnew
	rs("Content_Type")=Content_Type
	rs("YourName")=YourName
	rs("email")=email			
	rs("TelePhone")=TelePhone
	rs("Address")=Address
	rs("Zip")=Zip
	rs("updatetime")=now()
	rs("ClassID")=ClassID
	rs("Topic")=Topic
	rs("content")=content
	rs("AcceptNum")=gen_key(12)
	rs("E_PassWord")=E_PassWord
	rs("LeadMailIP")=LeadMailIP
	if ReviewCheck=1 then		'根据默认审核状态进行发信件审核状态的设置
		rs("Checked")=1
	else
		rs("Checked")=0
	end if
	
	rs.update
	
	set rs=conn.execute( "select * from "& db_wygkcn_LeadMail_Table&" order by LeadMailID desc ") 
    AcceptNum= rs("AcceptNum")
	
	rs.close
	set rs=nothing
	Response.cookies(echsys)("content")=""
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" lang="gb2312">
<head>
<title>发信成功__<%=eChSys_Com%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="CSS/Wygkcn_Home.css" rel=stylesheet type=text/css>
<LINK href="CSS/Wygkcn_News.css" rel="stylesheet">
</head>
<body>
<!--内容部分开始-->
<div id="EC_Content">
<!--#include file="Top.asp"-->
<!--位置导航部分开始-->
<div class="position">
<img src="Images/lm_dot.gif" width="11" height="11">&nbsp;&nbsp;您的位置&nbsp;&nbsp;<a href="./" >首页</a> >> <a href="wygkcn_Conmunicate.asp">交流互动</a> >> <a href="wygkcn_LeadMail.asp">校长信箱</a> >>写信成功</div>
<!--位置导航部分结束-->
<!--中间内容部分开始-->
<div class=back>
             您的申报成功，请耐心等待 审核、批阅!	<br />		  
			 您的受理编号是： <%response.write  AcceptNum %> &nbsp;&nbsp;知情密码是：<%response.write  e_password %><br />
			 请牢记!查询详细情况时将用到！<br />
			 <a href="wygkcn_LeadMail.asp">返回</a>
</div>
<!--中间内容部分结束-->

<!--#include file="bottom.asp"-->
<%Response.cookies(echsys)("content")=""
'response.redirect "wygkcn_LeadMail.asp"%>
</div>
<!--内容部分结束-->
</body>
</html>