I would like to implement an online polling system to allow users (not logged in) to indicate their preference.
I would like to show three choices to the user who first accesses the poll, and once a choice is selected, store it in the database and show the overall results of the poll up to that point.
When a user who had already voted comes back to the site I want to recognize him and not give him the opportunity to vote again for that poll.
I am using php to create the page and make the calls to the database and would like to use javascript to record the vote and show the results.
Since the users are not registered, I want to make sure that each user can only vote once by assigning them a unique identifier, especially to avoid that hackers could somehow create a denial of service with an attack on the site and “dirty” the database.
I had thought of using a cookie or IP address to identify the user, but both of those seem to be easily circumvented.
How can I do this?
MaX is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
9