johnnnn
02-28-2010, 04:20 PM
I'm working on a small project. It uses flat files, not MySQL. I know that anything being recorded to the database should be checked and cleaned.
I'm just wondering, should I use the following code in my function:
if(get_magic_quotes_gpc()) $str = stripslashes($str);
Making my cleansing function:
function cleaninput($str) {
$str = trim(strip_tags($str));
$str = htmlentities($str);
if(get_magic_quotes_gpc()) $str = stripslashes($str);
return $str;
}
Any suggestions?
I'm just wondering, should I use the following code in my function:
if(get_magic_quotes_gpc()) $str = stripslashes($str);
Making my cleansing function:
function cleaninput($str) {
$str = trim(strip_tags($str));
$str = htmlentities($str);
if(get_magic_quotes_gpc()) $str = stripslashes($str);
return $str;
}
Any suggestions?