php防注
程序员文章站
2022-07-11 08:14:19
$_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;
}
上一篇: 教练:你有心了