请教一下,我如何修改限制一天的投票次数,或一个IP只能投一次。
<%Set conn=Server.CreateObject("ADODB.Connection")
conn.open ConnStr
IF Request.Form("IsSub")="YES" THEN
SS=Request.Form("SS")
Set rs=conn.execute("Select Limit From Gq_Jzdata Where ID="&SS)
Limit=Cint(rs(0))
rs.close
No_Ok=False
IF Limit=2 THEN
IF Request.Cookies("cycoo_No_"&SS)="DONE" THEN
No_Ok=True
ELSE
Response.Cookies("cycoo_No_"&SS) = "DONE"
Response.Cookies("cycoo_No_"&SS).Expires = date()+1 '设置cookie的过期日
END IF
END IF
IF No_Ok=True THEN
Response.write "<script>alert('谢谢你对的支持\n\n请明天在来投票!');javascript:window.close()</script>"
ELSE
FOR each id IN Request.Form("rc")
conn.execute "Update Gq_Jzdata Set hits=hits+1 where ulock<>0 and id="&id
NEXT
rs.close
set rs=nothing
Response.write "<script>alert('谢谢的支持!');javascript:window.close()</script>"
END IF
Response.write "<Script language=JavaScript>window.open('Cycoo_VoteView.asp?ID="&SS&"','','width=420,height=350,scrollbars=yes');window.close();</Script>"
END IF
call CloseConn()
%>
红色部分,如何修改,可以让一天投十票。
或者有更好的,让一个IP一天只能投一票。