FORCING ONLY TEXT TO BE DISPLAYED ON YOUR PAGES - Aug 3rd, 2010


If your editors are savvy they can force html code to be displayed in what you’ve set up as a text only field with
some potentially negative effects on your page layout.

Here’s a hidden gem from Dave at Interactive Tools that can help to guard against that.
According to Dave, you can force the entry to be displayed as text (even if they enter HTML) by adding
"htmlspecialchars" in the display tag like this:



<?PHP echo htmlspecialchars($record['content']); ?>



That should dissuade any hot shot editors from bending the rules.



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service