![]() |
One Vote per IP
I have a application where users can vote for submission, and i want to make sure users dont spam it, how can i make this one vote per IP?
Code:
<script type="text/javascript"> |
You cannot do that with Javascript. You must use server-side coding.
All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit. |
Quote:
|
Quote:
|
Or ASP forum or Java forum...depending on what kind of server-side language you want to use.
|
It isn't exactly going to be fair though - where 1000 people are sharing the same IP only the first of them to vote will have their vote accepted while someone else whose IP address changes regularly will still be able to cast multiple votes.
Of course that may not matter depending on the requirements. |
|
use the ip as the primary key of a 2-col poll table.
the vote is an integer 0-5 or whatever. Code:
IP VOTEin this way, someone can update their vote, but they can't vote more times than you can reasonably screen against without sign-in. yes, they can vote at the coffee shop, on their phone, and at work, but they can't sit there and vote 500 times in a row... |
But Felgall's point needs to be considered as well: Many people use large-scale ISPs or are on machines behind a company firewall. In such cases, you can have hundreds or even thousands of users (e.g., Microsoft has only a handful of outward facing IP addresses for all its thousands of emploeyees) with the same IP address. So if one person using that ISP or from that company votes, nobody else will be able to.
Now, maybe you don't care about these people, and that's really fine. Just be aware that the problem exists. |
| All times are GMT +1. The time now is 05:59 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.