% dim action : action=getForm("action","get") if action="add" then addGbook dim FaqID,FaqTitle,Contact,ContactWay,Content,Reply,AddTime,ReplyTime,FaqStatus,AuditStatus,tab,sql Sub addGbook if getForm("code","post")<>Session("Code") then alertMsgAndGo "验证码不正确","-1" 'if session("faq") then alertMsgAndGo "请不要重复提交","-1" FaqTitle=filterPara(getForm("FaqTitle","post")) Contact=filterPara(getForm("Contact","post")) ContactWay=filterPara(getForm("ContactWay","post")) Content=encode(filterPara(getForm("Content","post"))) AddTime=now() FaqStatus=false AuditStatus=false tab=split(getForm("tab","post"),",") dim tabStr : tabStr="" dim tabValue : tabValue="" dim valueStr : valueStr="" dim i :i=0 dim rsObj sql = "select tabField,tabControlType from {prefix}tabSet order by tabOrder,tabID" Set rsObj=Conn.Exec(sql,"r1") '0 文本,1 数字,2 编辑器,3 附件,4 日期,5 颜色,6 单选,7 多选 Do While not rsObj.Eof tabStr = tabStr&","&rsObj(0) if rsObj(1) = 2 then valueStr = valueStr & ",'" &encode(getForm(rsObj(0),"post")) & "'" else valueStr = valueStr & ",'" &getForm(rsObj(0),"post") & "'" end if i=i+1 rsObj.MoveNext Loop rsObj.Close : set rsObj=Nothing 'if isnul(FaqTitle) then alertMsgAndGo "问题不能为空","-1" 'if isnul(Contact) then alertMsgAndGo "内容不能为空","-1" 'if isnul(Content) then alertMsgAndGo "联系人不能为空","-1" 'if isnul(ContactWay) then alertMsgAndGo "联系方式不能为空","-1" Conn.Exec"insert into {prefix}GuestBook(LanguageID,FaqTitle,Contact,ContactWay,Content,AddTime,FaqStatus,AuditStatus"&tabStr&") values("&setting.languageID&",'"&FaqTitle&"','"&Contact&"','"&ContactWay&"','"&Content&"','"&AddTime&"',"&FaqStatus&","&AuditStatus&""&valueStr&")","exe" session("faq")=true if messageReminded then sendMail messageAlertsEmail,"杰作网络项目组","关于"&setting.companyName&"的留言提醒!","
尊敬的客户:
您的网站"&setting.companyName&"有新的留言信息!
"&"
问题:"&FaqTitle&"
内容:"&Content&"
联系人:"&Contact&"
联系方式:"&ContactWay&"
时间:"&AddTime&"