注册 登录
编程论坛 ASP技术论坛

关于怎么防止重复投票问题

guang2356447 发布于 2009-09-28 20:03, 842 次点击
我的代码    但是现在的投票数  一天就能几十万   

请问高手   怎么有效防止    重复投票     
只要一台机器一天只能投一票  

用IP地址   有的是服务器代理的 不太准确

if Request.cookies("dwww")="" then
Response.cookies("dwww")=123
Response.cookies("dwww").Expires=Date()+1
exec="select * from tp where id="&request.querystring("id")
set rss=server.createobject("adodb.recordset")
rss.open exec,conn,1,3
rss("tps")=rss("tps")+1
rss.update
rss.close
set rss=nothing
%>
<script language="javascript">alert('投票成功!谢谢!');location.href='tpp.asp'</script>
<%
else
%>
<script language="javascript">alert('感谢您的支持,您已经投过票了,谢谢!!');location.href='tpp.asp'</script>
<%
end if
conn.close
set conn=nothing
%>
6 回复
#2
xing5996662009-09-28 21:11
加个IP字段  在用IP检测
#3
wearecs2009-09-30 17:35
'获取准确IP
f_IP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")  

If f_IP = "" Then f_IP = Request.ServerVariables("REMOTE_ADDR")  
 
 '删除1天前的IP
 conn.execute("delete from y_ip where datediff('d',y_time,date())>=1")


#4
guang23564472009-09-30 21:44
Request.ServerVariables("HTTP_X_FORWARDED_FOR")是什么意思

Request.ServerVariables("REMOTE_ADDR") 又是什么意思   

帮忙解释下
#5
guang23564472009-09-30 21:46
还有我的投票记录

怎么无缘无故的  张的非常快   每个人 都是几十万拉

是不是别人攻击拉    非法投票也不能那么快啊
#6
无诲今生2009-09-30 21:54
用 Request.cookies和 Response.cookies实际上是行不通的,因为人家可能通过禁止cookies,这样当你使用 Request.cookies时获取的是空值,所以别人就可以重复投了
#7
yms1232009-10-02 16:13
以下是引用guang2356447在2009-9-30 21:44:12的发言:

Request.ServerVariables("HTTP_X_FORWARDED_FOR")是什么意思

Request.ServerVariables("REMOTE_ADDR") 又是什么意思   

帮忙解释下
http://topic.
Request.ServerVariables所有参数返回值的相关解释
1