当前位置:主页 > 软件编程 > PHP代码 >

php防注

时间:2021-03-05 12:43:55 | 栏目:PHP代码 | 点击:

$_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;
}

您可能感兴趣的文章:

相关文章