Link to home
Start Free TrialLog in
Avatar of ttheimer
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
Avatar of steelseth12
steelseth12
Flag of Cyprus image

try

<textarea cols="90" rows="30">
<? echo $html ?>

</textare>
Avatar of ttheimer
ttheimer

ASKER

Textarea produces a fixed-size input field.  Not a good fit for displaying database contents (essentially an on-screen report).
ASKER CERTIFIED SOLUTION
Avatar of steelseth12
steelseth12
Flag of Cyprus image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's what I needed!  The report now prints cleanly.  Thanks.