dptr1988 Posted June 25, 2006 Share Posted June 25, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/12887-trouble-with-textarea-for-an-online-editor/ Share on other sites More sharing options...
bobleny Posted June 26, 2006 Share Posted June 26, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/12887-trouble-with-textarea-for-an-online-editor/#findComment-49513 Share on other sites More sharing options...
dptr1988 Posted June 26, 2006 Author Share Posted June 26, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/12887-trouble-with-textarea-for-an-online-editor/#findComment-49516 Share on other sites More sharing options...
wildteen88 Posted June 26, 2006 Share Posted June 26, 2006 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_decodeThis will undo the changes htmlentities did, like so:[code]$file_contents = html_entity_decode($_POST['textareaName']);[/code] Quote Link to comment https://forums.phpfreaks.com/topic/12887-trouble-with-textarea-for-an-online-editor/#findComment-49577 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.