Forum Moderators: open
I am pulling some text from the database that has "&" in it..
When i validate my page i get the following error.
character "&" is the first character of a delimiter but occurred as data.
Any trick to get this page validated?
or will i have to change my text in database from
"&" to "&" ?
thanks
Vik
How are you putting text into the database?
I would have thought you would still want to store the "&" (rather than "&") in your database - if you later want to do any string comparison for instance? IMHO the "&" should only be converted to "&" prior to display in an HTML page. "&" is an 'HTML' entity afterall.
If using PHP, then you could call htmlspecialchars() [uk.php.net] or htmlentities() [uk.php.net] prior to outputting your page.