Hello guys!
I have one problem that is driving me around...
I have a STRING varible with special chars(", ', &, \, ...) inside it.
And I want to do all following operations with that variable without problems that I have now (truncating when it comes to " char -when I want to print it as HTML, or putting into SESSION, or some other problems - printing "TEST" as \"TEST\" etc.)...
So, these are operations:
- storing to database,
- getting from database,
- printing from PHP to HTML and
- putting/getting from SESSION
- printing in JavaScript
- if entering also HTML tags in TEXTAREA I want to display it as HTML on result page.
I make one thing working but then other is wrong.
I used functions:
addslashes(), stripslashes(), htmlspecialchars()...
So I want when collecting parameters (with i.e. " inside) from form fields to put that in SESSION and to use it on other pages. I also want to write it correctly to database and to correctly read from database. Also when printing as VALUE atribute in i.e. INPUT form element
I want to print it correctly like i.e:
I want to "PRINT" this
and not like:
I want to \"PRINT\" this
Where I can read about these problems, or do you have some solution?
Thanks