Hello everyone
I have a vote system, and Ill explain how does it work.
There are some websites called toplists that contains the top 100 items in it (depending on vote count).
Okay so I've made a voting system
, that will have 5 different buttons, linking to different toplists.
Some toplists have callback (A GET callback), and some doesn't.
I want to trick the client, so it will make sure he will vote, I know it is impossible to 100% guarantee, but possible to trick the client from cheating.
My idea:
When user clicks on one of the links, he will have to wait 8 seconds
before clicking the 'submit' button, to get his voting points.
First result in my head: JavaScript.
And that's how I was planning to do this: (Just example, it is not the actual code!)
#buttonid.click (function() {
var time = **current_time + 8 seconds**
});
#submit.click(function() {
if (current_time < time) {
return error 1
} else {
process...
});
This is a little example of how I thought of doing this, so variable time = this current time
when he clicked on the button, + 8 seconds
.
So when he clicks submit, it checks if the current time
is less
than variable time by seconds
. If yes, then return an error message
.
But I am not to sure how to do so. Is that a good way of doing this?
basically this is my question:
How can I trick the client? Any other ways?.
How can I do the JavaScript seconds + time trick?
I would probably just use setTimeout
:
#buttonid.click (function() {
setTimeout(function () {
/* enable submit button */
}, 8000);
});
But keep in mind doing anything client-side isn't very secure, this would be trivial to bypass.