I want to check whether the POST request coming from various user input forms in my application contains any MALICIOUS CODE script or HTML tags if any found I want to redirect back to the form page and display a message that these script characters are not allowed. I can check for this functionality in the controller but I want to do this with middleware, how to do that, can anyone help me??
Please note, I am just a beginner, not that expert, so please forgive me for any errors in question or logic.
The expected result is that, I want to check on form submit that any input field contains any script tags or not? and I want to achieve this via MIDDLEWARE so that I can just include this middleware on requests i want to check.