<!--#include file="conn.asp" -->
<!--#include file="inc/function.asp"-->
<%
dim ip,rs,sql,book_title,book_name,book_email,book_tel,book_qq,book_address,VerifyCode,ssfl
set rs=server.createobject("adodb.recordset")
sql="select * from book"
rs.open sql,conn,1,3
ssfl=request.form("ssfl")
book_title=Checkxss(trim(request.form("book_title")))
gbook_sh=trim(request.form("gbook_sh"))
book_name=Checkxss(trim(request.form("book_name")))
book_email=trim(request.form("book_email"))
book_tel=trim(request.form("book_tel"))
book_qq=trim(request.form("book_qq"))
yc_email=request.form("yc_email")
yc_qq=request.form("yc_qq")
book_address=Checkxss(trim(request.form("book_address")))
book_body=Checkxss(trim(request.form("book_body")))
VerifyCode=request.form("VerifyCode")
ip=request.servervariables("remote_addr")
if VerifyCode="" then 
response.Write("<script language=javascript>alert('验证码不能为空!');history.go(-1)</script>") 
response.end
end if
if cstr(Session("firstecode"))<>cstr(Request.Form("VerifyCode")) then
response.Write("<script language=javascript>alert('验证码错误!');history.go(-1)</script>")
response.End
end if
if yc_email<>1 then
yc_email=0
end if
if yc_qq<>1 then
yc_qq=0
end if
rs.addnew
rs("ssfl")=ssfl
rs("book_title")=book_title
rs("book_name")=book_name
rs("book_email")=book_email
rs("book_tel")=book_tel
rs("book_qq")=book_qq
rs("yc_qq")=yc_qq
rs("yc_email")=yc_email
rs("book_address")=book_address
rs("book_body")=book_body
rs("add_ip")=ip
rs("passed")=gbook_sh
rs.update
rs.close
set rs=nothing
if gbook_sh=0 then
Response.Write "<script>alert('恭喜你，留言提交成功！');window.location.href='index.asp';</script>" 
else
Response.Write "<script>alert('恭喜你，留言提交成功！但需要经过管理员审核过才能显示！');window.location.href='index.asp';</script>"
end if
%>

