function
sql_check(
$Sql_Str
) {
//自动过滤Sql的注入语句。
$check
=preg_match(
'/select|insert|update|delete|\'|\\*|\*|\.\.\/|\.\/|union|into|load_file|outfile/i'
,
$Sql_Str
);
if
(
$check
) {
echo
'<script language="JavaScript">alert("系统警告:\n\n请不要尝试在参数中包含非法字符尝试注入!");</script>'
;
exit
();
}
else
{
return
$Sql_Str
;
}
}
function
safe(
$s
){
//安全过滤函数
if
(get_magic_quotes_gpc()){
$s
=
stripslashes
(
$s
); }
$s
=mysql_real_escape_string(
$s
);
return
$s
;
}