I'm having a problem inserting a less than sign "<" followed by another character let's say "<p" or something like "<---me". Im passing thru this function:
function checkValues($value)
{
$value = trim($value);
if (get_magic_quotes_gpc())
{
$value = stripslashes($value);
}
$value = strtr($value,array_flip(get_html_translation_table(HTML_ENTITIES)));
$value = strip_tags($value); //this line doesnt accept lessthan
$value = mysql_real_escape_string($value);
$value = htmlspecialchars ($value);
return $value;
}
I know if I remove the strip_tags() lessthan sign will be accepted, but is it safe to save it to the database right after passing thru my function? Or is there a way to let the lessthan sign pass through this function without any problem on saving to database?