php用户自定过滤非法sql注入字符串函数
function uc_addslashes( $string , $force = 0, $strip = false) { !defined( 'magic_quotes_gpc' ) && define( 'magic_quotes_gpc' , get_magic_quotes_gpc()); if (!magic_quotes_gpc || $force ) { if ( is_array ( $string )) { foreach ( $string as $key => $val ) { $string [ $key ] = uc_addslashes( $val , $force , $strip ); } } else { $string = addslashes ( $strip ? strips教程lashes( $string ) : $string ); } } return $string ; } if (!function_exists( 'daddslashes' )) { function daddslashes( $string , $force = 0) { return uc_addslashes( $string , $force ); } } //php 过滤函数应用实例phpfensi测试数据 $get = $_get ; $g = uc_addslashes( $get , $force = 0, $strip = false); //过滤post提交数据 $post = $_post ; $p = uc_addslashes( $post , $force = 0, $strip = false);查看更多关于php用户自定过滤非法sql注入字符串函数 - php函数的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did30772