<!--#include virtual="/aspsha/stopSQLIn.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/safe.asp"-->
<%
dim errmsg
errmsg=""

dim uname,email,content

uname=trim(ReplaceBadChar(request.Form("uname")))
email=trim(ReplaceBadChar(request.Form("email")))
content=iHTMLEncode(request.Form("content"))

'on error resume next
set rs=server.CreateObject("adodb.recordset")
sql="select * from jianyi where uname='"& uname &"' and email='"& email &"'"
rs.open sql,conn,1
if not(rs.eof or rs.bof) then
  errmsg=errmsg+"<li><strong><font size=4>您已经提交过此信息，请不要重复提交！</font></strong>"
end if 
rs.close
set rs=nothing

if uname="" then errmsg=errmsg+"<br>"+"<li>您的帐号不能为空！"
if checkshit(uname) then  errmsg=errmsg+"<br>"+"<li>帐号可能含不文明词语，请检查！"

if errmsg<>"" then 
response.Write "错误信息：<br>"
response.write("　　　"+ errmsg)
response.Write "<input type='button' value='返回修改' onClick='javascript:window.history.back(-1);'>"
response.Write "<input type='button' value='关闭窗口' onClick='javascript:window.close();'>"
response.end
end if

set rst=server.CreateObject("adodb.recordset")  
sql1="select * from jianyi where id is null"
rst.open sql1,conn,1,3
rst.addnew
rst("uname")=uname
rst("email")=email
rst("content")=content
rst("dtime")=now()
rst.update
rst.close
set rst=nothing

conn.close
set conn=nothing
response.Write "<script language='javascript'>alert('您的投诉建议信息已经成功提交！');window.location='service.asp'</script>"
response.end
%>