I have the following function that sanitizes input from the user or the url:
function SanitizeString($var)
{
$var=stripslashes($var);
$var=htmlentities($var, ENT_QUOTES, 'UTF-8');
$var=strip_tags($var);
return $var;
}
I dont know whether to use that function in addition to this php function:
mysql_real_escape_string()..
I also dont know if I take all the precautions to sanitize that input
I also have a problem of stripping tags..cause I am using tiny_MCE..and not stripping them is important..
How do I return the state of the html characters as html characters before they were feed into the database?
mysql_real_escape_stringis the only one you need for database, then if you need to output it usehtmlspecialcharsor something similar.