ttheimer
asked on
How to display HTML code from database using PHP and preventing the browser from interpreting the code.
I have html code contained in a database (MySQL) of code maintenance information. I want to be able to display the html code without having the code interpreted.
Is there a php function to encode the html so that it displays as text (showing all of the tags)? Or is there an HTML tag set that stops the interpretation of content between tags?
Thanks
Is there a php function to encode the html so that it displays as text (showing all of the tags)? Or is there an HTML tag set that stops the interpretation of content between tags?
Thanks
ASKER
Textarea produces a fixed-size input field. Not a good fit for displaying database contents (essentially an on-screen report).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's what I needed! The report now prints cleanly. Thanks.
<textarea cols="90" rows="30">
<? echo $html ?>
</textare>