%add_ja="1"%>
<%
randomize
randm=Int((9000*rnd)+1000)
IF Request("POST")="True" Then
ChkRand
ChkAdminLog
End IF
%>
<%
IF Request("POST")<>"" Then
Call WriteData
End IF
Main
Bottom
Function Main
%>
<%End Function
Function WriteData
LyContent=ChkZangHua(Trim(Request.form("content")))
LyName=ChkZangHua(Trim(Request.form("name")))
LyTitle=ChkZangHua(Trim(Request.form("title")))
site=Request.form("site")
Mail=Request.form("mail")
if Request.form("qq")<>"" then
UserQQ=Request.form("qq")
else
UserQQ="0"
end if
LyType=Request.form("type")
posttime=session("posttime")
if posttime+30/86400>now() then
response.write ""
Response.End
end if
IF LyContent="" or Lyname="" or LyTitle="" Then
call ShowErr("所有必填项.请认真填写")
ELSEIF CheckHtml(Lyname) or StrLength(Lyname)>12 then
call ShowErr("名字不能用特效和过滤字符")
ELSEIF StrLength(Lytitle)>30 then
call ShowErr("留言标题不要大于15个中文字")
ELSEIF strLength(LyContent)>lymax then
call ShowErr("你的留言太长了")
ELSEIF UserQQ<>"" and not isnumeric(UserQQ) then
call ShowErr("联系号码.必须全是数字")
ELSEIF strLength(LyContent)"" and not CheckEmail(Mail) then
call ShowErr("Email 填写不对")
ELSEIF Request.form("pass")="" and LyType="close" then
call ShowErr("私密留言.填写留言密码.可查阅站长回复")
Else
Set Rs = Server.CreateObject("ADODB.Recordset")
Sql = "Select * From gb"
Rs.Open Sql,conn,1,3
Rs.AddNew
shenhe=LyType
if shhe="1" then
shenhe="wait"&shenhe
end if
if Request.form("pass")<>"" then
Rs("psw")=MD5(Request.form("pass"))
end if
if UserQQ<>"" then
Rs("oicq")=UserQQ
end if
Rs("content")=HTMLcode(LyContent)
Rs("date")=now
Rs("title")=HTMLcode(LyTitle)
Rs("name")=HTMLcode(Lyname)
Rs("from")=Trim(Request.form("from"))
Rs("type")=shenhe
Rs("site")=Request.form("site")
Rs("mail")=Mail
Rs("top")=Request.form("top")
Rs("ip")=Request.form("ip")
Rs.Update
Rs.Close
Set Rs=Nothing
Call CloseDB
session("posttime")=Now()
%>
<%if goto_email="1" then%>
<%end if%>
<%
Response.Redirect "index.asp"
End IF
End Function
%>
<%
Function ChkRand
IF Request.form("randm1")="" then
response.write ""
Response.End
ELSE
IF Request.form("randm1")<>Request.form("randm2") then
response.write ""
Response.write ""
Response.End
END IF
END IF
End Function
%>