Put the public calling file (such as conn database link file), filter the special string for all GET or POST data, so as to achieve simple and effective SQL injection filtering.

复制代码代码如下所示:
功能inject_check($ sql_str){
返回eregi('select |插入|和|或|更新|删除| | / * * | | / | , / |联盟|为| load_file | outfile ',sql_str美元);
}
如果(inject_check($ _server { 'query_string ' })= = 1或inject_check(file_get_contents(PHP: / /输入))= = 1){
非法访问的警告!;
标题(位置:错误;
}