<% cid=85 sid=109 %> <%set book=conn.execute("select * from book_setup") sitename=book("sitename") admin=book("admin") password=book("password") maxlength=cint(book("maxlength")) view=book("view") pages=cint(book("pages")) html=cint(book("html")) mailyes=cint(book("mailyes")) book_jianju=cint(book("book_jianju")) huifutishi=cstr(book("huifutishi")) huifucolor=cstr(book("huifucolor")) bad=cstr(book("bad")) set book=nothing '检查用户输入的内容中是否含有非法字符 function checktxt(txt) chrtxt="33|34|35|36|37|38|39|40|41|42|43|44|47|58|59|60|61|62|63|91|92|93|94|96|123|124|125|126|128" chrtext=split(chrtxt,"|") for c=0 to ubound(chrtext) txt=replace(txt,chr(chrtext(c)),"") next checktxt=txt end function if request("send")="ok" then if Trim(Session("WellCome"))="" then username=trim(request.form("pname")) usermail=trim(request.form("email")) if checktxt(request.form("pname"))<>request.form("pname") then response.write "
" response.end end if if mailyes=0 then '邮箱为必填时检查邮箱是否合法 if checktxt(request.form("email"))<>request.form("email") then response.write "
" response.end end if if Instr(usermail,".")<=0 or Instr(usermail,"@")<=0 or len(usermail)<10 or len(usermail)>50 then response.write "
" response.end end if end if if len(request.form("Comments"))>maxlength then response.write "
" response.end end if Comments1=request.form("Comments") bad1=split(bad,"/") '过滤脏话 for t=0 to ubound(bad1) Comments1=replace(Comments1,bad1(t),"***") next if request.form("Comments")<>Comments1 then response.write "
" response.end end if set rs=Server.CreateObject("ADODB.RecordSet") sql="select * from Feedback where online='1' order by Postdate desc" rs.open sql,conn,1,3 rs.Addnew rs("username")=Request("pname") rs("comments")=Request("content") rs("usermail")=Request("email") rs("face")=Request("face") rs("pic")=Request("pic") rs("url")=Request("phone") rs("qq")=Request("qq") rs("zyzbook")="csef" rs("lytitle")=oa.sqlrequest("lytitle") rs("lx")=oa.sqlrequest("lylx") view=cstr(view) if view<>"0" then view="1" rs("online")=view rs("IP")=Request.serverVariables("REMOTE_ADDR") rs.Update rs.close set rs=nothing Session("WellCome")="1" response.write "
" response.end else response.write "
" response.end end if end if %>
在线留言

在此输入你的留言信息