discuz的php防止sql注入函數(shù)
分享一下discuz論壇的sql防注入函數(shù),寫(xiě)的不錯(cuò)。就跟隨百分網(wǎng)小編一起去了解下吧,想了解更多相關(guān)信息請(qǐng)持續(xù)關(guān)注我們應(yīng)屆畢業(yè)生考試網(wǎng)!
復(fù)制代碼 代碼如下:
$magic_quotes_gpc = get_magic_quotes_gpc();
@extract(daddslashes($_COOKIE));
@extract(daddslashes($_POST));
@extract(daddslashes($_GET));
if(!$magic_quotes_gpc) {
$_FILES = daddslashes($_FILES);
}
function daddslashes($string, $force = 0) {
if(!$GLOBALS['magic_quotes_gpc'] || $force) {
if(is_array($string)) {
foreach($string as $key => $val) {
$string[$key] = daddslashes($val, $force);
}
} else {
$string = addslashes($string);
}
}
return $string;
}
【discuz的php防止sql注入函數(shù)】相關(guān)文章:
php防止sql注入漏洞過(guò)濾函數(shù)的代碼11-30
PHP面試之php自帶的幾個(gè)防止sql注入的函數(shù)11-04
php防止SQL注入的方法12-04
php怎么防止sql注入02-04
php防止SQL注入的方法分享11-05
php中防止SQL注入的方法10-12
在PHP中該怎樣防止SQL注入10-28
PHP中該怎樣防止SQL注入10-04
php中防止SQL注入的解決方法01-02