1234
11
12
13
14
15
16
17
18
19
20
21
27
28
29
30
31
32
33
34
35
36
37
38unc 38399 inject_check($sql_str)
{
returneregi('select|insert|and|or|update|delete|'//file|outp|'/file| ',
$sql_str);
|
}
function verify_id( $id =null)
{
if (! $id )
{
exit
( '沒有提交參數!'
);
}
elseif
(inject_check( $id ))
{
exit
( '提交的參數非法!');
elseif (! is_numeric ($id ))
{
exit ( '所提交的參數非法!');
}
$id = intval ( $id );
return $id ;
}
function str_check( $str ) {
{
$str = addslashes ( addslashes ( );
//
進行過濾
}
$str =
str_replace ( "_" ,
"_" ,
$str );
$str = str_replace
( "%" ,
"%" ,
$str );
return $str ;
}
function post_check( $post )
{
if (!get_magic_quotes_gpc())
{
$post =
addslashes }
$post
= str_replace
( "_" ,
"_" ,
$post );
$post = str_replace ( "%" ,
"%" ,
$post );
$post = nl2br ( $post );
$post = htmlspecialchars( $post
);
return $post ;
}
|