答复: [PHP] Close all open tags in HTML text
| From: | yangshiqi | Date: | Thu, 09 Dec 2004 07:22:32 +0000 |
| Subject: | 答复: [PHP] Close all open tags in HTML text | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203793@lists.php.net to get a copy of this message | ||
May be you could use a iframe to ensure your own page much safer,
despite show the users' inputs is very dangerous.
-----邮件原件-----
发件人: Raditha Dissanayake [mailto:jabber@raditha.com]
发送时间: 2004年12月9日 12:26
抄送: php-general@lists.php.net
主题: Re: [PHP] Close all open tags in HTML text
Matt Palermo wrote:
>I am allowing users to imput HTML code into a textarea. After they input
>this, I wany to output their HTML to the browser. In order for the
document
>to be safe, I need to close all open HTML tags that have been left open by
>the user, along with any open comments. Is there a way to take an HTML
>string and add closing tags and comments to it if needed?
>
>
Certainly not impossible but by no means an easy task. You would be
doing the job of an html validator and it's probably better for you to
use a third party library for that than to code it yourself.
>Thanks,
>
>Matt
>
>
>
--
Raditha Dissanayake.
------------------------------------------------------------------
http://www.radinks.com/print/card-designer/ |
Card Designer Applet
http://www.radinks.com/upload/ | Drag and
Drop Upload
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php