<!--#include file="conn1.asp"-->


<%if request.Form("content")="" then
response.write "<script language=javascript>alert('请输入留言！');history.go(-1);</script>"
response.End
end if%>
<%if request.Form("nichen")="" then
response.write "<script language=javascript>alert('请输入！');history.go(-1);</script>"
response.End
end if%>
<%if request.Form("shouji")="" then
response.write "<script language=javascript>alert('请输入！');history.go(-1);</script>"
response.End
end if%>
<%if request("verifycode")="" then
	response.write "<script LANGUAGE='javascript'>alert('请输入确认码！');history.go(-1);</script>"
	response.end%>

<%end if%>
<%if IsNumeric(request("verifycode"))=False or IsNumeric(request("verifycode"))="" then
		response.write"<SCRIPT language=JavaScript>alert('参数错误-请输入数字验证码');"
		response.write"javascript:history.go(-1)</SCRIPT>"
        response.end
		end if%>
		
		<%if csng(Session("VerifyCode"))<>csng(Request.Form("VerifyCode")) then
	response.write "<script LANGUAGE='javascript'>alert('您输入的确认码有误，请重新输入！');history.go(-1);</script>"
	 response.end
	end if%>

<%sql="select * from liuyan"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
rs("nichen")=request.form("nichen")
rs("shouji")=request.form("shouji")
rs("lyjjr")=int(request.QueryString("jjrid"))
rs("state")=request.form("state")
rs("content")=request.form("content")
rs.update
rs.close
set rs=nothing%>

<%response.write "<script language=javascript>alert('留言成功！');window.location.href='viewhouse.asp?id="&request.QueryString("id")&"';</script>"%>
