Security
|Thachthat.biz|
today : | at : | safemode : ON
> / home / root /public_html / it.thachthat.biz /
Name User Perms Com Modified Label

cách filter(lọc) ký tự để tránh bị khai thác Sqli(sql injection) Unknown rwxr-xr-x 0 09:40

Filename cách filter(lọc) ký tự để tránh bị khai thác Sqli(sql injection)
Permission rw-r--r--
Author Unknown
Date and Time 09:40
Label
Action


function chong_loi_code($str){
$a = "/(\'|\"|\=|\(|\)|\-|union|select|from|order|group|by|tables?|\#|\s|or|and|\_|\/|\!|\*|\%|\+)/";
preg_match_all($a,$str,$kq);
if(isset($kq[0])){
foreach($kq[0] as $loi){
$str = strip_tags(preg_replace($loi,NULL,$str));
}
if (preg_match_all($a,$str,$kq)){
chong_loi_code($str);
}
else{
return $str;
}
}
}

0 nhận xét:

 

Jayalah Indonesiaku © 2014 IT Thạch Thất
VB (Vio b374k) Template design by Thachthat.biz