Jump to content

Archived

This topic is now archived and is closed to further replies.

dptr1988

Trouble with textarea for an online editor

Recommended Posts

I made an online text file editor that uses < TEXTAREA>....< /TEXTAREA> tags for the editor. The problem is that if you try to edit a file that contains < /TEXTAREA> the browser will close the textare right there and the rest of the file after is parsed as HTML. Can I disable the < /TEXTAREA> tag without modifying any of the text. Is there another multi-line editory in HTML that i can put any text into?

Thanks

Share this post


Link to post
Share on other sites
Can we see what your talking about? Can we see the html? From what I understand, you have a text in the <textarea>TEXT</textarea> and then the text after it is being displayed as text?

Share this post


Link to post
Share on other sites
Here is a sample of my editor [a href=\"http://dptr1988.mooo.com/editor_test.php\" target=\"_blank\"]http://dptr1988.mooo.com/editor_test.php[/a] View the source for a better understanding of what I'm wanting. How can I have the < /TEXTAREA> tag in a textarea?

Share this post


Link to post
Share on other sites
I would suggest you use htmlentities when the data is pulled into the textarea like so:
[code]<textarea ... blah ...><?php echo htmlentities($file_contents); ?></textarea>[/code]
then when you got to save the changes use a function called html_entity_decode

This will undo the changes htmlentities did, like so:
[code]$file_contents = html_entity_decode($_POST['textareaName']);[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.