<!--#include file="conn/conn.asp" -->
<!--#include file="conn/function.asp" -->
<!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=utf-8" />
<title>万能表单</title>
</head>
<body>
<%
M_id=session("M_id")
if M_id="" then
M_id=6
end if

if M_id=6 then
url_to="index.asp"
else
url_to="member/member_form.asp"
end if

F_id=request.QueryString("F_id")
action=request.QueryString("action")

if action="input" then
	if request.Form("code")<>Session("CmsCode") then
		call box("验证码错误!","back","error")
	else
		R_time=now()
		R_rid=gen_key(15)
		For Each x In Request.Form 
		if x>0 then
			if Request.Form(x)="" then
				call box("请填全内容后提交!","back","error")
				response.End()
			else
				if IsValidStr(Request.Form(x))=false then
				call box("含有非法字符，请重新输入！","back","error")
				else
				conn.execute("Insert into SL_response(R_cid,R_content,R_time,R_rid,R_member) values("&x&",'"&Replace_Text(Request.Form(x))&"','"&R_time&"','"&R_rid&"',"&M_id&")")
				end if
			end if
		end if
		Next 
		call sendmail("您的网站有新的表单提交","<h2>您的网站“"&C_webtitle&"”有新的表单提交</h2><hr></hr>请进入“网站后台” - “表单系统” - “查看统计”查看详情！",C_email)
		call box("提交成功",C_dir&url_to,"success")
	end if
end if
%>
</body>
</html>