To write a generic SQL anti-injection module ~~~~~ hope to give some idea
Website input place More ~ ~ Each input place is deliberately to write a piece of code engineering volume is larger ~ ~ So I want to write a class ~ ~ when needed to introduce classes and functions to form onsubmit when checking input ~ ~ But each form input items are not the same ~ ~ So want to know if there is a universal SQL anti-injection module ~ ~ ~ How is the idea?
XSS also need to guard ~ ~ So also want to know a common XSS defense module is how ~ ~ Thank you thank you ~ ~
------Solution--------------------
Anti-injection can be consulted here
Http://www.w3school.com.cn/php/func_mysql_real_escape_string.asp
XSS prevention can be converted to HTML entities using Htmlspecialchars ().
------Solution--------------------
The common approach is to traverse the submitted data for content filtering.