Function getIP()
getIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If getIP = "" Then getIP = (Request.ServerVariables("REMOTE_ADDR"))
End Function
ipdate=getIP&date()
if ipdate<>"" then
Set rs = Server.CreateObject( "ADODB.Recordset" )
sql = "select * from Result where ipdate='" & ipdate & "' "
rs.open sql,conn,1,3
if not (rs.bof and rs.eof) or Session("vote")="yes" then
Response.write("alert('您已经投票,请稍后再来投票!\n );location='index.asp';")
else
rs.addnew
rs("voteid")=id
rs("addip")=getIP
rs("ipdate")=ipdate
rs.update
rs.close
Set rs=nothing
idArr=split(id,",")
for i=0 to ubound(idArr)
sql="update Info set ps=ps+1 where id in("&trim(idArr(i))&")"
conn.execute(sql)
Response.write "alert('恭喜您,投票成功,谢谢您的参与!\n );location='index.asp';"
next
Session("vote")="yes"
end if
end if
end if
%>