当前位置:Gxlcms > PHP教程 > php防注_PHP教程

php防注_PHP教程

时间:2021-07-01 10:21:17 帮助过:19人阅读

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

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/317793.htmlTechArticle$_POST=sql_injection($_POST); $_GET=sql_injection($_GET); functionsql_injection($content) { if(!get_magic_quotes_gpc()){ if(is_array($content)){ foreach($contentas$key=$value){ $con...

人气教程排行