<!-- #include file="sd_mdb.asp"-->
<%
sd_xm=request.form("sd_xm")
sd_qq=request.form("sd_qq")
sd_log=request.form("sd_log")
verifycode=request.form("verifycode")

if cstr(session("getcode"))<>cstr(trim(verifycode)) then
	response.Write "<script LANGUAGE='javascript'>alert('请输入正确的验证码！');history.go(-1);</script>"
	response.end
end if

if sd_xm="" or sd_qq="" or sd_log="" then
	Response.Write ("<script language=javascript>alert('昵称、QQ、留言内容填写不完整！');history.back(-1);</script>")
	Response.End
end if

if sd_xm<>"" and  instr(sd_xm,"<") or instr(sd_xm,">") or instr(sd_xm,"=") or instr(sd_xm,"'") or instr(sd_xm,"#") or instr(sd_xm,"$") or instr(sd_xm,"@") or instr(sd_xm,"*") or instr(sd_xm,"|") or instr(sd_xm," ") or instr(sd_xm,"%") or instr(sd_xm,"&") or instr(sd_xm,"ヴ") or instr(sd_xm,"+") or instr(sd_xm,"^") or instr(sd_xm,"!")  then
Response.Write "<script>alert('姓名非法，不能含有特殊符号！');history.back();</Script>"
response.end
End If

if sd_log<>"" and  instr(sd_log,"<") or instr(sd_log,">") or instr(sd_log,"=") or instr(sd_log,"'") or instr(sd_log,"#") or instr(sd_log,"$") or instr(sd_log,"@") or instr(sd_log,"*") or instr(sd_log,"|") or instr(sd_log,"%") or instr(sd_log,"&") or instr(sd_log,"ヴ") or instr(sd_log,"+") or instr(sd_log,"^") or instr(sd_log,"!")  then
Response.Write "<script>alert('留言内容非法，不能含有特殊符号！');history.back();</Script>"
response.end
End If

set rs=server.createobject("adodb.recordset")
sql="select * from [sd_book]"
rs.open sql,conn,3,2
	rs.addnew
	rs("sd_xm")=sd_xm
	rs("sd_qq")=sd_qq
	rs("sd_log")=sd_log
	rs.update
	rs.close
	set rs=nothing
	Response.Write ("<script language=javascript>alert('留言成功，待审核后显示！');this.location.href='sd_book.asp';</script>")
	Response.End
%>