Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 696393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:03:32+00:00 2026-05-14T03:03:32+00:00

Im working on a website (html,css,javascript, ajax, php,mysql), and I want to restrict the

  • 0

Im working on a website (html,css,javascript, ajax, php,mysql), and I want to restrict the number of times a particular user votes for a particular video.

Its similar to the YouTube system where you can voteUp or voteDown a particular video.

Each vote involves adding a row to the video.votes table, which logs the time, vote direction(up or down), the client IPaddress( using PHP: $ip = $_SERVER[‘REMOTE_ADDR’]; ), and of course the ID of the video in question.

Adding votes is as simple as; (pseudocode): Javascript:onClick( vote( a,b,c,d ) ), which passes variables to PHP insertion script via ajax, and finally we replace the voteing buttons with a “Thank You For Voting” message.

THE PROBLEM:

If you reload/refresh the page after voting, you can vote again, and again, and again, you get the point.

MY QUESTION:

How do you limit the amount of times a particular user votes for a particular video??

MY THOUGHTS:

Do you use cookies, and add a new cookie with the id of the video. And check for a cookie before you insert a new vote.?

OR

Before you insert the vote, do you use the IPaddress and the videoID to see if this same user(IP) has voted for this same video(vidID) in the past 24hrs(mktime), and either allow or dissallow the voteInsertion based on this query?

OR

Do you just not care? Take the assumption that most users are sane, and have better things to do than refresh pages and vote repeatedly.??

Any suggestions or ideas welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:03:32+00:00Added an answer on May 14, 2026 at 3:03 am

    Do you use cookies, and add a new cookie with the id of the video. And check for a cookie before you insert a new vote.?

    Cookies can be easily disabled or very quickly cleared. Saving a vote to a cookie is unreliable and votes could be gamed with no problem.

    Before you insert the vote, do you use the IPaddress and the videoID to see if this same user(IP) has voted for this same video(vidID) in the past 24hrs(mktime), and either allow or dissallow the voteInsertion based on this query?

    Many users could be using the same router, effectively having the same IP. By doing this, you could be irritating users by stopping them from voting because another person from the same office/household has already voted on the video before sending them the link.

    Do you just not care? Take the assumption that most users are sane, and have better things to do than refresh pages and vote repeatedly.?

    This is entirely subjective and dependant on the importance of the votes. If voting is an important part of the site, it’s best to care as much as you possibly can. For instance, if videos were sorted on highest rated, some users could vote many times to increase the popularity of their personal/favourite video, giving the impression of popularity to attract more views.

    Where voting is important, it’s best to only allow registered users to vote. Sure, people can and will make multiple accounts to vote (see http://gallery.live.com for an example), but you’re making it a lot harder for them. If voting is not really important I would go with the cookie option.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working on an AJAX website (HTML,CSS,JavaScript, AJAX, PHP, MySQL). I have multiple javascript functions
I have working website in PHP with a MySQL backend which has several tables
I'm working on this website http://www.eluminatecreative.com/new/index.html and where it says sum'r fling I need
I'm working on a website where users can create and save their own HTML
hey i guys i want help from you. i am working on website project,
So I have this PHP website that I am working on that using templates.
I'm completely new to HTML, CSS and Javascript but drawing on previous knowledge of
I've recently been working on streamlining my website and leaning up my HTML and
I already have a working OOP website. Most of the php is separated from
I'm currently working on a website that works without any javascript. I'm going to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.