投票

<% dim voteArr,voteItemArr,catalogid if(request.QueryString("catalogid")<>"") then catalogid=Clng(request.QueryString("catalogid")) end if if instr(request.cookies("TotVote"),"vote")<>0 then Response.Write("
") response.end end if '投票数组 Set rs = Server.CreateObject("Adodb.RecordSet") rs.Open "Select id,catalogid from t_survey_vote order by id asc",conn,3,1 if not rs.eof then voteArr=rs.GetRows() else response.Write("没有找到记录") response.End() end if rs.close set rs=nothing '开始按vote循环 for votei=0 to ubound(voteArr,2) if(request.Form("vote"&voteArr(0,votei))<>"") then voteitemid=Cint(request.Form("vote"&voteArr(0,votei))) conn.Execute("update t_survey_item set clicks=clicks+1 where id="&voteitemid) end if response.cookies("TotVote")="vote" response.cookies("TotVote").Expires=Date+365 next conn.Execute("update t_survey_stat set votenum=votenum+1 where catalogid="&catalogid) response.Write("
") %>
<% call connclose() %>