Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

echo to <textarea> problem

Status
Not open for further replies.

brownfox

Programmer
Joined
Jan 5, 2003
Messages
173
Location
GB
I want to allow people to edit .html files that they have uploaded to my server. I use fopen and fread to echo the contents of the file to a <textarea>. The problem is that some of the files contain javascript and html. The javascript is echoed out OK thus:
<script language=&quot;javascript&quot; type=&quot;text/javascript&quot;>
But strict html like this:

&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;

Gets interpereted by the browser and displays in the <textarea> like this:
<script language=&quot;javascript&quot; type=&quot;text/javascript&quot;>
Is there any way to force the <textarea> to display the raw html and not the interpereted (encoded?) html?
Any help would be greatly appreciated...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top