最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php防注入代码方法 过滤所有GET POST
时间:2022-07-02 09:13:25 编辑:袖梨 来源:一聚教程网
/* 过滤所有GET过来变量 */
foreach ($_GET as $get_key=>$get_var)
{
if (is_numeric($get_var)) {
$get[strtolower($get_key)] = get_int($get_var);
} else {
$get[strtolower($get_key)] = get_str($get_var);
}
}
/* 过滤所有POST过来的变量 */
foreach ($_POST as $post_key=>$post_var)
{
if (is_numeric($post_var)) {
$post[strtolower($post_key)] = get_int($post_var);
} else {
$post[strtolower($post_key)] = get_str($post_var);
}
}
/* 过滤函数 */
//整型过滤函数
function get_int($number)
{
return intval($number);
}
//字符串型过滤函数
function get_str($string)
{
if (!get_magic_quotes_gpc()) {
return addslashes($string);
}
return $string;
}
这里我们是告诉各位朋友关于php防注入代码方法 过滤所有GET POST哦,因为大多数据都是能过get post 方法注入,当然还有files
相关文章
- 会计随身学如何注销账号 04-19
- QQ邮箱网页版主页链接是什么 04-19
- 如何删除wps页面 04-19
- 手机微博网页版如何看热搜 04-19
- 儿歌多多如何查看个人音频 04-19
- 东呈会积分如何抽奖 04-19