N
N
NibiruanChild2017-01-13 15:50:54
PHP
NibiruanChild, 2017-01-13 15:50:54

How to safely confirm the completion of an action on a website (php, html, js, jquery)?

There is a page on which the user must perform certain actions, for simplicity, let's take the timer waiting, that is, the visitor enters the page and must stay on it for N times.

After completing the task, a button should appear, when pressed, it is recorded in the database that he completed the task.

If it is just a hidden button / form / link, then it can be snatched from the page source and bypass the task.

How to protect yourself from detours?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Stroykin, 2017-01-13
@NibiruanChild

  • The user went to the page -> made an entry in the database. For example: user id and time
  • As soon as the user clicked on the button, we make a request to the database and compare: the time when he clicked the button and the time from the database (the first minus the second). If less than necessary, we throw an error, if more or exactly, then the task is completed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question