php防注
程序员文章站
2022-04-08 23:32:04
$_post = sql_injection($_post); $_get = sql_injection($_get); func...
$_post = sql_injection($_post);
$_get = sql_injection($_get);
function sql_injection($content)
{
if (!get_magic_quotes_gpc()) {
if (is_array($content)) {
foreach ($content as $key=>$value) {
$content[$key] = addslashes($value);
}
} else {
addslashes($content);
}
}
return $content;
}
$_get = sql_injection($_get);
function sql_injection($content)
{
if (!get_magic_quotes_gpc()) {
if (is_array($content)) {
foreach ($content as $key=>$value) {
$content[$key] = addslashes($value);
}
} else {
addslashes($content);
}
}
return $content;
}
上一篇: 知名企业都是怎么开始的
下一篇: php生成EXCEL的东东