Put it into a common call file (such as the conn database link file) and filter all GET or POST data with special strings to achieve simple and effective SQL injection filtering
Copy code The code is as follows:
Function inject_check($sql_str) {
return eregi('select|insert| and|or|update|delete|'|/*|*|../|./|union|into|load_file|outfile', $sql_str);
}
if (inject_check($_SERVER[' QUERY_STRING'])==1 or inject_check(file_get_contents("php://input"))==1){
//echo "Warning illegal access!";
header("Location: Error.php ");
}
http://www.bkjia.com/PHPjc/621681.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/621681.htmlTechArticle is placed in the public call file (such as the conn database link file) and filters all GET or POST data with special characters String to implement simple and effective SQL injection filtering. Copy the code. The code is as follows...