2016-10-13 00:16:48 点击量:14 标签: 收藏本文
[PHP]PHP最简单的代码防SQL注入的源代码
- Function inject_check($sql_str) {
- return preg_match('/select|insert|and|or|update|delete|\'|\/\*|\*|\.\.\/|\.\/|union|into|load_file|outfile/i', $sql_str);
- }
- if (inject_check($_SERVER['QUERY_STRING'])==1 or inject_check(file_get_contents("php://input"))==1){
- //echo "cuplayer.com提示:警告 非法访问!";
- header("Location: Error.php");
- exit;
- }
[PHP]PHP最简单的代码防SQL注入的源代码