SQL injection is to set SQL traps in input parameters, which can lead to malicious database operations and attack the database.
Verify the input parameters to prevent entering keywords and symbols that may lead to database operations. This is a way to prevent SQL injection.
// Prevent SQL Injection parameter verification function checkSql (value) {var reg =/select | update | delete | insert | alter | drop | exec | count | '| "| = |; | >|<|%/I; if (reg. test (value) {alert ("do not enter special characters and SQL keywords in parameters! "); Return false ;}
This is just an example of a simple verification method. It is not enough to pass the parameter to the backend. Verification is also required. In order to prevent attacks that directly initiate requests across the client. The backend verification method is similar to this method.