Confused when to use extra characters and when to use htmlentities

Possible duplicates:
Htmlentities vs addslashes vs mysqli_real_escape_string
When 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.

+3
source share
2 answers
  • Never use addlashes.

  • Also never use htmlentities() *

  • Use htmlspecialchars()when displaying untrusted content in the context of an HTML page.

, / , . , , - .

*= , . htmlentities() , , HTML, UTF-8. , htmlspecialchars(), . >

+5

, . , :)

htmlentities HTML-. PHP .

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)

+2

All Articles