欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

判断是否是多次提交留言 用if do while 有大用


'是否多次提交留言 超过一次
function is_many_liuyan()
Set rs_find_bm=Conn.Exec("select * from Message where ip='"&getipadd&"' order by id desc","r1")
if not rs_find_bm.eof then
data_from_db=rs_find_bm("data")
minute_diff = dateDiff("n",data_from_db,now())
if minute_diff<5 then
alertMsgAndGo "你已经报过名了","-1"
end if
end if
rs_find_bm.close
set rs_find_bm=nothing
end function


'是否多次提交留言 超过两次
function is_many_liuyan_two()
i=0
Set rs_find_bm=Conn.Exec("select * from Message where ip='"&getipadd&"' order by id desc","r1")
do while not rs_find_bm.eof
data_from_db=rs_find_bm("data")
minute_diff = dateDiff("n",data_from_db,now())

if minute_diff<5 then
i=i+1
end if
rs_find_bm.movenext
loop
rs_find_bm.close
set rs_find_bm=nothing
if i >= 2 then
alertMsgAndGo "你已经报过名了","-1"
end if
end function




普通分类: