-
-
function jk1986_checksql()
- {
- $bad_str = "and|select|update|'|delete|insert|*";
- $bad_array = explode("|",$bad_str);
- /** 过滤get参数 **/
- foreach ($bad_array as $bad_a)
- {
- foreach ($_get as $g)
- {
- if (substr_count(strtolower($g),$bad_a) > 0)
- {
- echo "<script>alert('诡异字符,请不要尝试注入本站! 作者:jk1986 qq:414028660');location.href='index.php';</script>";
- exit();
- }
- }
- }
/** 过滤Post参数 **/
foreach ($bad_Array as $bad_a)
- {
- foreach ($_POST as $p)
- {
- if (substr_count(strtolower($p),$bad_a) > 0)
- {
- echo "<script>alert('诡异字符,请不要尝试注入本站! 作者:Jk1986 QQ:414028660');location.href='index.php';</script>";
- exit();
- }
- }
- }
/** 过滤Cookies参数 **/
foreach ($bad_Array as $bad_a)
- {
- foreach ($_COOKIE as $co)
- {
- if (substr_count(strtolower($co),$bad_a) > 0)
- {
- echo "<script>alert('诡异字符,请不要尝试注入本站! 作者:Jk1986 QQ:414028660');location.href='index.php';</script>";
- exit();
- }
- }
- }
- }
- ?>
立即学习“PHP免费学习笔记(深入)”;
-
复制代码
|