D
D
Danil Sysoev2015-04-25 06:05:14
Programming
Danil Sysoev, 2015-04-25 06:05:14

How to limit the number of clicks on input to 1 time per day?

Guys, the next question. How to make the user (authorized) click on the input in the personal account and the next time he could do it only in a day?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Petrov, 2015-04-25
@YoungOldMan

On the client
Write to cookie , localStorage . After validation, set the disabled attribute .
Unreliable - the user can log in from another browser, from another device.
Store on the server the time of the last click for the user. When generating a page, set the disabled attribute if necessary .
Reliable - everything is determined unambiguously for an authorized user, regardless of device or browser.

D
Danil Sysoev, 2015-04-25
@YoungOldMan

Right. I thought to add a table to the users database that would record the date of the click. Further report. But in which section of the documentation to look to find out how to make changes to the table when you click on the button.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question