SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    Unauthorized Web Theologian emmzee's Avatar
    Join Date
    Jan 2004
    Location
    Mississauga, Ontario, Canada
    Posts
    738
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rating system: Best way to limit to 1 vote

    I'm considering adding a rating system to one of my sites, but I don't want to have to force visitors to sign up. In order to limit people to one vote per game, should I use both cookies and tracking of IP addresses? Or is there another option that I haven't thought of?

    Should I just force people to register?

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It depends on the nature of the site and how 'precise' you want to be. I wouldn't bother with IP addresses as they can/might change too frequently. For most cases a cookie will do. If you want to be a little more 'precise' then i'd just make people register and use the database to store who's voted on what.

  3. #3
    SitePoint Wizard Young Twig's Avatar
    Join Date
    Dec 2003
    Location
    Albany, New York
    Posts
    1,355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can always register with two names. The best way to store their fingerprint in the database.

  4. #4
    SitePoint Evangelist djdykes's Avatar
    Join Date
    Feb 2005
    Location
    Chester, Cheshire
    Posts
    565
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Young Twig
    You can always register with two names. The best way to store their fingerprint in the database.
    just off topic a little - have you seen the new IBM think pad that allows you to use your finger print as a password?

  5. #5
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would create a table with the fields
    id | ip | timestamp

    Then each time a rating is cast check that the ip does not exist in the table

    if it does don't add a count tro your rating. If not add the rating.

    Write a script that can be run automatically like a cron job. each hour have a script that deletes all ips that are more than one hour old according to the timestamp in the table.

    But that is just the way I would do it.

    This way the user thinks they are adding multiple ratings but really they only add the one.

  6. #6
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    UK
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On my site I work with just IP checking. Once you force uers to register to vote they probably won't bother.

    For example on my site users register to upload work but other then being able to be sent the odd alert I can't see why a casual viewer would register just to be able to vote.

  7. #7
    SitePoint Addict
    Join Date
    Feb 2004
    Location
    Netherlands
    Posts
    381
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    a cookie will do

  8. #8
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sergeant
    a cookie will do
    So you would store the id of the rating and then next check that they cookie did not exist. this is a simple way around turn cookies off.

  9. #9
    SitePoint Zealot swiftone's Avatar
    Join Date
    Mar 2005
    Location
    Sunny Florida
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use a cookie for long time tracking, but it can be deleted by a savvy person. How many would bother though?

    You could also use the IP, but if they are on a dialup or PPPOE they could simply logoff and login to change their IP unless they have a static IP.

    You could also use $_SESSION to track those that did not close their browser and try to come back.

    A user account is another way if you want to make people login to vote.
    Happy Coding,
    Swiftone

    Unique Web Sites

  10. #10
    SitePoint Addict
    Join Date
    Feb 2004
    Location
    Netherlands
    Posts
    381
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Quote Originally Posted by noddy
    So you would store the id of the rating and then next check that they cookie did not exist. this is a simple way around turn cookies off.

    Yup


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •