Faced such a problem: You need to make a limit on the number of form submission per minute. Suppose the form can be sent 3 times in 1 minute, 30 seconds. Yuzal Google, but I did not find it. As I understand it, this is implemented using $ _REQUEST.
2 answers
You can track the number of form submissions using the session. As soon as the user logged in, start the session. After the first form is sent, we also fix the time and number of successful poisonings in the session. In subsequent attempts, we check the time of the last form submission and the number of successful shipments, if it is within the required limits, send the form, if not, print the corresponding. notification.
- @ Sharp-sighted browser restarted - killed the session. As a variant daza bath. - Oleg
|
I suggest this:
- a user came in, pressed a button, output the message to him all successfully;
- write to the database, user information (Individual user number, date, IP, and so on);
- and when you press a button, check ID, IP, and Date.
- So is it still best to use databases? All the same extra requests. Using databases, you can do this: 1) A person submits a form, we put in a table and indicate the time of drift. 2) We check in time his latest messages. (But this option seems to me bad and not convenient). But with the help of cookies, sessions, "global variables" how is this implemented? - Elected
- Here you say cookies and sessions, yes you can use cookies and sessions, but suppose this situation: 1. went in, clicked 2. wanted to click again (cleared the cookie, and session) clicked a second time, and so on if it doesn’t matter, then you can stop at sessions or cookies - FreeMast
- In principle, you are right. But still I would like to find an alternative to databases. - Elected
- you can write to the file, if you do not want to base - FreeMast
- Especially not an option. - Elected
|