Support » Plugins » Ajax Function: Once Per User Per Post

  • Hello,

    I’m calling a voting function via admin ajax, and this function stores a user’s ID and post ID in a custom table called “votes”, in order to ensure that a user can’t vote more than once per post.

    Just before inserting a new vote I query this custom table to make sure that they haven’t already voted, which works perfectly when there is a reasonable amount of time between votes. The trouble is when they click the voting button really fast many times. This seems to get around my check by initializing my voting function several times before any records exist in my custom voting table.

    Is there a better way to ensure that each user can vote only one time?

  • The topic ‘Ajax Function: Once Per User Per Post’ is closed to new replies.