Re: how to write </textarea> element in textarea?
| From: | Andrew Ballard | Date: | Fri, 01 May 2009 14:49:28 +0000 |
| Subject: | Re: how to write </textarea> element in textarea? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-292190@lists.php.net to get a copy of this message | ||
On Fri, May 1, 2009 at 10:44 AM, Grega Leskovsek <mavricek@gmail.com> wrote:
> I am writing CMS, that will be able to edit files.
> For editing I put file inside textarea, but when I open file that has
> textarea element inside it I lose (read: don't show data in the
> textarea element.) the data after the inside </textarea> element.
> Any suggestions how can I fix this?
>
> Thanks in advance,
>
You need to use htmlspecialchars on whatever you place inside the textarea:
<textarea name="content"><?php echo htmlspecialchars($content);
?></textarea>
Andrew