Re: Best way to display html in textarea?
| From: | Lowell Allen | Date: | Mon, 17 Jun 2002 19:08:27 +0000 |
| Subject: | Re: Best way to display html in textarea? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-102563@lists.php.net to get a copy of this message | ||
> From: Leif K-Brooks <eurleif@buyer-brokerage.com>
>
> I know this isn't strictly php, but here goes. I am trying to display
> html source that a user enters in a textarea. If they enter any bad
> html, the textarea "eats up" the rest of the page. Is there any way to
> make this not happen (other than making them use good html)?
>
Use htmlspecialchars() or htmlentities() to convert the html for display.
<http://www.php.net/manual/en/function.htmlspecialchars.php>
<http://www.php.net/manual/en/function.htmlentities.php>
--
Lowell Allen