最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 防sql注入过滤代码
时间:2010-11-30 编辑:简简单单 来源:一聚教程网
function phps教程ql_show($str){
$str = stripslashes($str);
$str = str_replace("\", "", $str);
$str = str_replace("/", "/", $str);
$str = str_replace(" ", " ", $str);
$str = str_replace(",", ",", $str);
return $str;
}
function phpsql_post($str){
$str = stripslashes($str);
$str = str_replace("|", "|", $str);
$str = str_replace("<", "<", $str);
$str = str_replace(">", ">", $str);
$str = str_replace(" ", " ", $str);
$str = str_replace(" ", " ", $str);
$str = str_replace("(", "(", $str);
$str = str_replace(")", ")", $str);
$str = str_replace("`", "`", $str);
//$str = str_replace("'", "'", $str);
$str = str_replace('"', """, $str);
$str = str_replace(",", ",", $str);
$str = str_replace("$", "$", $str);
$str = str_replace("", "\", $str);
$str = str_replace("/", "/", $str);
return $str;
}
function phpsql_replace($str){
$str = stripslashes($str);
$str = str_replace("'", "'", $str);
return $str;
}
-
上一个: php 符转换为 HTML 实体
相关文章
- php过滤sql注入关键词分析 05-20
- PHP导出数据超时的优化建议解读 10-31
- PHP之mysql位运算解析 10-31
- Laravel实现登录跳转功能解析 10-31
- php双向队列解读 10-31
- Laravel异常上下文解决教程 10-24