...

View Full Version : is there a way to restrict voting to once a day?



shedokan
01-03-2008, 04:26 PM
I have a poll and I want to allow user to vote only once a day.
I save the data in a table named "polls_vote" and I have 2 columns there:
pollid
ipAddress

and I use this mysql query to check if there is already one ip in the table:
SELECT * FROM polls_vote WHERE ipAddress = '$ip' AND pollid = '$pollId'

if you need any more info ask.
thanks.

mlseim
01-03-2008, 05:06 PM
I'm at a workplace that has 20 computers.
Nothing would keep me from voting 20 times ... each one has a unique IP address.

But I guess if you saved a date value of when I voted along with the vote,
you could ignore any more votes from the same IP (if the date was the same).
It would cut down on multiple votes.

I wouldn't mention anything ... just ignore any extra votes without any indication.

If someone knows you are checking their IP, they would be more tempted to abuse it.

CFMaBiSmAd
01-03-2008, 05:22 PM
The reverse it true too, most of the computers behind a router will have the same IP address. Do you want to limit a company that might have 10, 100, or 1000 people to just one vote?

Using an IP address for anything other than just activity logging and reporting purposes is unreliable, because an IP address does not identify any single visitor.

IP addresses can be different for the same visitor on different visits (either deliberately if he want to vote more than once or accidentally if he is using a dial up connection and got a new IP address just because he connected again) and several visitors can have the same IP address (either because they are in a network where that IP address is shared or because they got assigned the IP address on one visit that someone else previously had on their visit.)

If you describe what type of voting is taking place, someone can provide a more reliable method.

arnyinc
01-03-2008, 05:51 PM
There's no good way to do this.

If you use cookies, people can just clear their cookies.

The two significant issues with using IP addresses have already been mentioned.

If you make people register with an email, people aren't going to want to give out their email address and go through the whole process just for a little poll. Plus they can register several times with different free email addresses.

mlseim
01-03-2008, 07:19 PM
I agree with all of the posts ...

Online Polls are not reliable and should just be used for "fun".

Let us know what the purpose is ... how important the poll really is.

Don't think that a "leave a comment" guest book will be any better.
You'll get comments that are somewhat questionable and probably vulgar.

The internet is great for posting your thoughts and ideas, but without
moderation and censorship, accepting ideas from others is usually a bad idea.

====

I tried talking a local church into eliminating their "open" online guestbook.
They insisted on leaving the guestbook online.
.
.
... I see it's not online anymore :)


.

shedokan
01-04-2008, 02:29 AM
It's for a fan website about neopets.

the voting is anonymous so any user can press vote and the vote is added to the database.
and I'm using ajax so the page doesn't needs reloading.


Do you want to limit a company that might have 10, 100, or 1000 people to just one vote?
people from a company don't need to vote but to work.

ziggy1621
01-04-2008, 02:33 AM
I'm at a workplace that has 20 computers.
Nothing would keep me from voting 20 times ... each one has a unique IP address.


This is not altogether true as those 20 computers have separate Internal IP addresses, but their external (which is all that this script would see) is the same.

So it is still not completely legit because only 1 of those 20 will be able to vote per day, but if you are not aiming at work as per your last post...

people from a company don't need to vote but to work.
then writing something to check by IP should work for what you are aiming at.

shedokan
01-04-2008, 06:25 AM
but then users can only vote once per a poll and not once per a day.

CFMaBiSmAd
01-04-2008, 06:44 AM
Dormitory Internet connections at a University would also share single/few IP addresses. Likewise, hot spots, Internet Cafés, and people that go to their library to connect would have many people behind one IP address.

shedokan
01-04-2008, 06:45 AM
ok, so what do you think I should do?

mlseim
01-04-2008, 01:17 PM
For Neopets ... go ahead and do it.

It's for fun and the demographics is kids.

To keep a child from hitting the vote button over
and over again, just set a session variable.

Alternatively, you could use a cookie with a 12 or 24 hour expiration.

I don't think kids will keep opening and closing
their browser to vote.

shedokan
01-04-2008, 01:28 PM
ok, thanks for the advice.
I will go with cooies because sessions last only 5 minutes.

mlseim
01-04-2008, 11:59 PM
sessions only last 5 minutes?

That must be a hosting PHP setting.
Sessions on my site last as long as the browser is open.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum