📄 message_do.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Response.CodePage=65001%>
<%Response.Charset="UTF-8"%>
<!--#include file="db_conn.asp"-->
<!--#include file="func.asp"-->
<%
If isMsg="0" Then
response.redirect "error.asp?err=199"
response.end
End If
name=ReplaceBadChar(Trim(request.form("name")))
silent=ReplaceBadChar(Trim(request.form("silent")))
contact=ReplaceBadChar(Trim(request.form("contact")))
content=request.form("content")
If silent<>"1" Then silent="0"
If session("postNum")>0 Then
code=cint(request.form("code"))
If code<>Session("GetCode") Then
Response.redirect "error.asp?err=126"
response.End
End if
End If
FoundErr=0
msgFilter=Replace(msgFilter,",",",")
fWordList=split(msgFilter,",")
for i=0 to ubound(fWordList)
if instr(name,fWordList(i))>0 then
FoundErr=1
exit for
elseif instr(content,fWordList(i))>0 then
FoundErr=1
exit for
else
FoundErr=0
end if
next
if strLength(name)<1 Or strLength(contact)<1 Or strLength(content)<1 Then
Response.redirect "error.asp?err=121"
elseIf strLength(name)>20 Then
Response.redirect "error.asp?err=122"
ElseIf strLength(contact)>50 Then
Response.redirect "error.asp?err=123"
ElseIf strLength(content)<4 Or strLength(content)>400 Then
Response.redirect "error.asp?err=124"
ElseIf FoundErr=1 Then
Response.redirect "error.asp?err=125"
ElseIf session("postNum")>3 Then
Response.redirect "error.asp?err=127"
else
sqlStr="insert into WP_msg(msg_name,msg_contact,msg_content,msg_isSilent,msg_addTime) values('"&name&"','"&contact&"','"&HTMLEncode(content)&"','"&silent&"','"&Now()&"')"
conn.execute(sqlStr)
'发送邮件
If mailPassword<>"" Then
mailcontent="留言人:"&name
mailcontent=mailcontent&"<br/>留言时间:"&Now()
mailcontent=mailcontent&"<br/>联系方式:"&contact
mailcontent=mailcontent&"<br/>留言内容:"
mailcontent=mailcontent&HTMLEncode(content)
isSend=SendMail(mailAddress,"手机留言板最新留言",mailcontent)
'response.write isSend
End if
If session("postNum")="" Then
session("postNum")=1
Else
session("postNum")=session("postNum")+1
End if
Response.redirect "info.asp?info=211"
End if
Set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -