If you tell your browser
<input type=text value="he said, \"foo!\".">
we and PHP are assuming that the two escaped quotes are part of the string and that the two unescaped strings delineate the string itself.
Your browser is thinking that the string begins at the first quote and ends at the second, and ignores the backslashes. So in my example above, the page would show [he said, \"] as the value of the input. If you use stripslashes, the HTML code would be
<input type=text value="he said, "foo!".">
so your browser would show the value as [he said, ].
Here's what's happening to your string in the code example in my previous post. Assume I input the text, [he said, "foo!"].
At the beginning of the script's run, the value of $_POST['foo'] is set to [he said, \"foo!\"]. the stripslashes function changes that to [he said, "foo!"]. The htmlentities function changes that to [he said, [ignore]&[/ignore]quote;foo![ignore]&[/ignore]quote;], which displays correctly. (HTML entity tags are hard to get write in Tek-Tips. That result of the last transformation should read [he said, *ampersand*quot*semicolon*foo!**ampersand*quot*semicolon*])
You can either store that last version of the text in your database or reverse the entity tag changes. See the section on get_html_translation_table() (
for more information. ______________________________________________________________________
TANSTAAFL!