Page 1 of 1
best way to get visitors once
Posted: Tue Oct 26, 2004 5:33 am
by mcastles
i have a simple voting script with php and mysql that grabs a visitors ip address and stores it in the db. I only want to let the visitor add their ip once a day.
The problem is.. some people are voting from within a network that has a proxy server and it is only possible for anyone from within that network to vote once.
Is there a better option to use to identify users than ip?
I don't particularly want to use cookies because the visitors can cheat with them.
Thanks
Posted: Tue Oct 26, 2004 5:52 am
by Archy
Are the people voting members or are they visitors?
You could add their IP address to a database and then search for it when someone votes (could use preg_match for this). If that IP address has already voted, then dont allow the vote, if it hasn't been used, then allow the vote. You could also use a cron job to delete the contents of the cell every 24 hours automatically.
Posted: Tue Oct 26, 2004 5:54 am
by mcastles
sorry, they are visitors, but i don't want to get the ip address because it doesn't work for people behind a proxy server.
Posted: Tue Oct 26, 2004 6:03 am
by John Cartwright
Search these forums, this topic has been solved several times.
Posted: Tue Oct 26, 2004 6:05 am
by djot
-
Hi,
If you don't want to store IP and cookies, there is no way to identify visitors.
If they are members, you could store their voting status in the members database.
Only solution for non members and to not use IP is to use some encrypted cookie data.
djot
-
Posted: Tue Oct 26, 2004 8:05 am
by mcastles
hmmm, ok i thought those two were the only way, thanks
Posted: Tue Oct 26, 2004 8:24 am
by djot
-
Hi,
You can't get a perfect voting control over your visitors. Some may have a proxy, some a static IP. Same for cookies: most will allow cookies, some not. Users can get a new IP by just reconnecting to the internet, or just delete your cookie to vote again.
My prefered way would be to just check the IP, and forget about cookies and proxy users. (Depends on how serious the voting has to be for sure!)
If you have visitors and members, you can have two different votings, one for unknown visitors and one for known members. The control of members should be perfect, the one for visitors depends on how often they hack your votings. This way you would have two resultig opinions.
djot
-
Posted: Tue Oct 26, 2004 8:39 am
by mcastles
djot wrote:-
My prefered way would be to just check the IP, and forget about cookies and proxy users. (Depends on how serious the voting has to be for sure!)
-
yeah, i had the same idea when i created the script.. I didn't bother about cookies and just used ip addresses.. but now I have had a few complaints from people behind a proxy so I might need to change. Or even use a combination of the two.
Thanks djot,
Marc
Posted: Tue Oct 26, 2004 2:20 pm
by rehfeld
you could also limit the daily/hourly etc... votes from a specific ip address. they can still get around it if they try,
but we already know theres no way to do polling perfectly
Code: Select all
<?php
if (unique_cookie && ip_used_less_than_10times in last day) {
} else if (no_cookie && ip_used_less_than_3times in last day) {
}
?>
depending on whats it used for, maybe even assign a truthness value to votes. Votes that come from heavily used ips could be given a value of less than 1 vote, maybe .8 or somthing etc.....