Post voting system

Got an idea for a tutorial ? Share it here.
Post Reply
raigiano
Posts: 6
Joined: Sun Jan 26, 2014 6:36 pm

Post voting system

Post by raigiano »

I got a question. I used the post voting tutorial for my website, but i have one problem. The user can click more than one time on the vote link. I want to let the user just click one time on vote up or vote down. I want to ask you guys if you could help me with this. I have tried but it didn't work out as it supposed to be. Any help is welkom.

Thanks :D
User avatar
Helx
Posts: 350
Joined: Thu May 17, 2012 6:45 am
Location: Auckland, New Zealand

Re: Post voting system

Post by Helx »

When voting, save the users IP address along with the voting data.
When the user clicks the voting button, check the users current IP with all saved IP addresses. If there is a match, don't allow the vote.

I'm sorry I can't provide you with any code, but it should be pretty basic stuff - even if you Google how to do it.
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: Post voting system

Post by Temor »

Helx wrote:When voting, save the users IP address along with the voting data.
When the user clicks the voting button, check the users current IP with all saved IP addresses. If there is a match, don't allow the vote.

I'm sorry I can't provide you with any code, but it should be pretty basic stuff - even if you Google how to do it.

You can do this, or if you require the user to be logged in to vote you could just put his username or id in there to see if he has voted or not. This prevents any user from logging in on another device or network / vpn / proxy and voting repeatedly.
Post Reply