I have basic html stored in my database, which includes html such as the anchor tag.
I am storing all & in the database as &
However, when the data is displayed back on the screen, the anchor tags stop working because the & in the links become &
.
The problem is, the rest of the content around the anchor tag should remain as &
For example
The database content might look like this
<p>this is paragraph 1 & this is <a href="http://www.companyname.com/page.php?paragraph=2&sentence=4">paragraph 2</a>.</p>
The & in the url becomes &
which stops the url from working, but at the same time, the & in the
tab any any other tag should remain as &
should be encoded as & to be valid - http://htmlhelp.com/tools/validator/problems.html#amp
– Twelve47 Apr 20 '11 at 10:20` and `` and stuff), then why not require `&` to be stored as `&` as well? right now you are storing only partly valid html, since e.g. `& this…` is not a valid html entity
– knittl Apr 20 '11 at 10:26