每个 IP 地址限制 1 票? [英] Limit 1 vote per IP Address?

查看:28
本文介绍了每个 IP 地址限制 1 票?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真正想要的是限制每人 1 票,但我能想到的下一个最好的事情是每个 IP 地址限制 1 票,以防止恶意用户/黑客严重影响我公司的投票系统.我正在考虑使用数据库来跟踪 IP 地址.

What I really want is to limit 1 vote per person but the next best thing i can think of is limit 1 vote per IP address to prevent malicious users/hackers from severely tempering with my company's voting system. I was thinking of using a database to keep track of the IP addresses.

更新:很抱歉第一次没有说清楚.我想知道限制每个 IP 地址 1 票是否是限制每人 1 票的好策略.基本上,我想知道 1 个唯一 IP 地址是否大致等于 1 个人.人们已经提到代理和路由器重复使用 IP 地址,因此不幸的是,许多人可以使用相同的 IP 地址.

Update: Sorry about not being clear in the first time aruond. What i wanted to know if limiting 1 vote per IP address was a good strategy to limiting 1 vote per person. Basically, i wanted to know if 1 unique IP address is roughly equal to 1 person. People have already mentioned that proxies and routers re-use ip addresses so unfortunately, many people can be using the same ip address.

谢谢.我认为,就我而言,最好不要限制每个 IP 地址 1 票.

Thanks. I think, for my case, it'll be best to NOT limit 1 vote per ip address.

推荐答案

我建议不要采用 IP 方法.当我在您的一些大型 ISP 大量重复使用 IP(AOL...)之前查看此内容时,但如果您确实使用 IP 地址,请使用数据库来跟踪它们.一个快速的方法是让它成为一个唯一的键,并将异常捕获为已经投票".

I would suggest not going with the IP approach. When I looked at this before some of your large ISPs reuse IPs a lot (AOL...), but if you do use IP addresses, use a database to track them. A fast way to do it is to make it a unique key and to catch the exception as "already voted".

要添加的一个好处是不要向用户显示他们的投票没有被计算在内,只需显示结果,或者感谢他们的投票.如果不提供特定的错误,问题就会变得更加困难,有时甚至不会被问题用户注意到.

One good thing to add is not to show a user that their vote was not counted, just show the results, or thank them for voting. By not giving that specific error, it is harder and sometimes not even noticed by your problem users.

这篇关于每个 IP 地址限制 1 票?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆