tipa mysql injection apsauga function apsauga var if is_array var fore

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<?
//tipa mysql injection apsauga
function apsauga($var){
if(is_array($var)){
foreach($var as $key=>$value){
$var2[$key]=mysql_escape_string(htmlspecialchars($value));
}
}else{$var2=mysql_escape_string(htmlspecialchars($var)); }
return $var2;
}
?>