How to protect voting site from automated queries?

Discussion in 'PHP' started by glink1, Apr 11, 2008.

  1. #1
    Hi

    I'm doing site where unregistred people will vote
    on subjects.
    How to protect site from multiple votes from same user
    for same topic ?
    And how to check if someone votes for too much subjects (robots vote)?

    Site is in PHP and MySQL on shared hosting.
     
    glink1, Apr 11, 2008 IP
  2. DartPHP

    DartPHP Banned

    Messages:
    71
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Create a table called rate_log and record the topic id and the users IP and you can just check against that.
     
    DartPHP, Apr 11, 2008 IP
  3. jsmcm

    jsmcm Active Member

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    51
    #3
    Yes, I would do that, except that I would use a cookie too where possible because IP addresses change all the time...
     
    jsmcm, Apr 12, 2008 IP
  4. DartPHP

    DartPHP Banned

    Messages:
    71
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    People can change cookies more easily than change IPs.
     
    DartPHP, Apr 12, 2008 IP
  5. m0nkeymafia

    m0nkeymafia Well-Known Member

    Messages:
    399
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    125
    #5
    Dont do it against IP, as then if more than one person from the same building [think university] try to vote it wont let them.

    Use cookies and make sure they have a referrer [to protect against bots].
    And perhaps ensure that votes from the same IP are throttled so you can only vote once per hour from the same IP
     
    m0nkeymafia, Apr 12, 2008 IP
  6. coffear

    coffear Member

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    43
    #6
    If someone is hosted by for exampl AOL their ip changes with every request.

    If you have a HTML page with 10 images and a style sheet that is a total of 12 items. An AOL user could end up requesting each item with a different IP.
     
    coffear, Apr 12, 2008 IP
  7. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #7
    Do it with cookies and check against their IP, and if a referrer is supposed to be set, then do that as well.
     
    crazyryan, Apr 12, 2008 IP