Home > front end >  Judge illegal string input input
Judge illegal string input input

Time:09-26

$(" input "). The blur (function () {
//judgment have these strings
Var Cts=$(this). Val ();
Var arrs=[' script ', 'select', 'update' and 'drop', 'database', 'existsing', 'having', 'delete', 'create' and 'procedure', 'varchar', 'insert', 'into' and 'alter', 'table', 'the console];
for(var i=0; i If (Cts. IndexOf (arrs [I]) & gt;=0) {
Layer. The alert (' hint: you input text is sensitive characters, please fill out the submission again! Or contact the system maintenance personnel ');
$(this). Val (");
Return
}
}

});

CodePudding user response:

Lz here for loop is superfluous, if (! {$. InArray (Cts, arrs)) layer. The alert (' hint: you input text is sensitive characters, please fill out the submission again! Or contact the system maintenance personnel '); $(this). Val ("); Return}

  •  Tags:  
  • Ajax
  • Related