Home > Article > Backend Development > Anti-malware automatic form submission
Describe the problem scenario:
For example, forum posts, registration and other submission forms. There may be some malware that simulates the process of posting form data. How to prevent automatic submission?
Just to add: It’s best not to say verification code
Describe the problem scenario:
For example, when posting in a forum or submitting a form such as registration, there may be some malware that simulates the process of posting form data. How can you prevent automatic submission?
Just to add: It’s best not to say verification code
Define a random number session variable in the background;
Output this value in the input in the form.
After submission, it is judged whether the session is equal to the input value. If they are equal, the session value is changed.
This can effectively prevent repeated submissions. If you want to experience a better front-end and use JavaScript to optimize the interaction, you can check how CSRF is implemented.
1. Use CSRF,
2. Use verification code