360 general protection filters user input data to prevent injection:
1. Save the following code as a 360_safe3.php file and upload it to the Directory of the file to be included.
2. introduce the above 360_safe3.php File: require_once ('2017 _ safe3.php') on the page ');
If you want to protect your website against website injection, add it to a public file on the website, such as the database link file config. inc. php!
Error number:[$ Errno], error on line $ errline in $ errfile
"; Die () ;}set_error_handler (" customError ", E_ERROR); $ getfilter =" '| (and | or) \ B. +? (>|<|=| In | like) |\/\\ *. +? \ * \/| <\ S * script \ B | \ bEXEC \ B | UNION. +? SELECT | UPDATE. +? SET | INSERT \ s + INTO. +? VALUES | (SELECT | DELETE). +? FROM | (CREATE | ALTER | DROP | TRUNCATE) \ s + (TABLE | DATABASE) "; $ postfilter =" \ B (and | or) \ B. {1, 6 }? (=|>|<|\\ Bin \ B |\\ blike \ B) |\\/ \\ *. +? \ * \/| <\ S * script \ B | \ bEXEC \ B | UNION. +? SELECT | UPDATE. +? SET | INSERT \ s + INTO. +? VALUES | (SELECT | DELETE). +? FROM | (CREATE | ALTER | DROP | TRUNCATE) \ s + (TABLE | DATABASE) "; $ cookiefilter =" \ B (and | or) \ B. {1, 6 }? (=|>|<|\\ Bin \ B |\\ blike \ B) |\\/ \\ *. +? \ * \/| <\ S * script \ B | \ bEXEC \ B | UNION. +? SELECT | UPDATE. +? SET | INSERT \ s + INTO. +? VALUES | (SELECT | DELETE). +? FROM | (CREATE | ALTER | DROP | TRUNCATE) \ s + (TABLE | DATABASE) "; function StopAttack ($ StrFiltKey, $ StrFiltValue, $ ArrFiltReq) {if (is_array ($ StrFiltValue) {$ StrFiltValue = implode ($ StrFiltValue);} if (preg_match ("/". $ ArrFiltReq. "/is", $ StrFiltValue) = 1) {// slog ("
Operation IP address: ". $ _ SERVER [" REMOTE_ADDR "]."
Operation Time: ". strftime (" % Y-% m-% d % H: % M: % S ")."
Operation page: ". $ _ SERVER [" PHP_SELF "]."
Submission method: ". $ _ SERVER [" REQUEST_METHOD "]."
Parameter submitted: ". $ StrFiltKey ."
Submit data: ". $ StrFiltValue); print" 360 websec notice: Illegal operation! "; Exit () ;}// $ ArrPGC = array_merge ($ _ GET, $ _ POST, $ _ COOKIE ); foreach ($ _ GET as $ key = >$ value) {StopAttack ($ key, $ value, $ getfilter);} foreach ($ _ POST as $ key => $ value) {StopAttack ($ key, $ value, $ postfilter);} foreach ($ _ COOKIE as $ key => $ value) {StopAttack ($ key, $ value, $ cookiefilter);} if (file_exists ('update360. php ') {echo "please rename the file update360.php to prevent hackers from using
"; Die ();} function slog ($ logs) {$ toppath = $ _ SERVER [" DOCUMENT_ROOT "]. "/log.htm"; $ Ts = fopen ($ toppath, "a +"); fputs ($ Ts, $ logs. "\ r \ n"); fclose ($ Ts) ;}?>