<% dim errmsg,errflag errmsg="错误信息:

" '设置灌水限制 if cint(posttime)<>0 then if not isnull(session("posttime")) or cint(posttime)>0 then if DateDiff("s",session("posttime"),Now())留言本防灌水功能已经打开,斑竹限制"&posttime&"秒内不能重复留言。" errflag=true end if end if end if if request("name")="" or request("email")="" or request("content")="" or request("where")="" then errmsg=errmsg&"

  • 没有填写完整:姓名、邮件、内容等是必须的。
  • " errflag=true end if '使用屏蔽昵称 if usesplitwords=1 then check_name=request("name") splitwords1=split(splitwords1,",") for i = 0 to ubound(splitwords1) if instr(check_name,splitwords1(i))>0 then errmsg=errmsg&"
  • 您使用了屏蔽的昵称。
  • " errflag=true exit for end if next end if '使用屏蔽字符 check_content=request("content") if usebadwords=1 then badwords1=split(badwords1,",") for i = 0 to ubound(badwords1) if instr(check_content,badwords1(i))>0 then check_content=replace(check_content,badwords1(i),"***") end if next end if if IsValidEmail(trim(request("email")))=false then errmsg=errmsg&"
  • 邮件地址填写出错:请确认你的邮件地址。
  • " errflag=true end if if len(request("content"))>maxtext then errmsg=errmsg&"
  • 内容填写出错:字数不能超过"&maxtext&"。
  • " errflag=true end if %>
    <%=errmsg%>
    <% if errflag<>true then Set rs=Server.CreateObject("ADODB.Recordset") sql="SELECT * FROM gb" rs.Open sql,conn,1,3 rs.Addnew rs("name")=Server.Htmlencode(Request("name")) rs("email")=Server.Htmlencode(Request("email")) rs("site")=Server.Htmlencode(Request("site")) rs("content")=Server.Htmlencode(check_content) rs("where")=Server.Htmlencode(Request("where")) rs("ip")=request.servervariables("remote_addr") rs("time")=now() rs.Update rs.Close Set rs=Nothing if cint(posttime)<>0 then session("posttime")=now() end if Response.Redirect"gb.asp?提示=添加新留言操作成功" end if %>