Possible duplicates:Htmlentities vs addslashes vs mysqli_real_escape_stringWhen to use the line erase method?
Hi, I am very confused when I use addlashes and when to use htmlentities.
Could you tell me an example where I should use addlashes and when to use htmlentities.
Never use addlashes.
Also never use htmlentities() *
htmlentities()
Use htmlspecialchars()when displaying untrusted content in the context of an HTML page.
htmlspecialchars()
, / , . , , - .
*= , . htmlentities() , , HTML, UTF-8. , htmlspecialchars(), . >
, . , :)
htmlentities HTML-. PHP .
htmlentities
htmlspecialchars() , htmlentities(), , HTML, .
, htmlentities() UTF-8 ! , . http://www.phpwact.org/php/i18n/charsets#common_problem_areas_with_utf-8
addslashes , , MySQL (mysql_real_escape_string)
addslashes
mysql_real_escape_string