- 相關(guān)推薦
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ù)的代碼08-22
PHP面試之php自帶的幾個(gè)防止sql注入的函數(shù)06-14
php防止SQL注入的方法10-13
php怎么防止sql注入10-15
php中防止SQL注入的方法06-16
php防止SQL注入的方法分享09-29
PHP中該怎樣防止SQL注入05-23
在PHP中該怎樣防止SQL注入07-25
php中防止SQL注入的解決方法11-04