Re: HTML tags in database fields

From: Date: Wed, 11 Jul 2001 18:32:50 +0000
Subject: Re: HTML tags in database fields
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-57464@lists.php.net to get a copy of this message
"Rodrigo" <rodrigo@shreve.net> wrote in message news:3B4C948D.A6F93013@shreve.net... > Hello. I wrote a comments application that allows the use of some HTML > tags for text formatting (<i><b>). I ran into a problem of users not > closing the tags (</i></b>), so when I display a page with all the > comments, if the user did not close the <b> tag then all the text in the > other comments is bold. > > Is there a solution to this? I'd just check for open tags on form submit, and then bitch and moan about it if there are any... (e.g. leave it up to the user...) With a good contains_open_tags() function you'll also be able to accept more tags like TABLE and DIV (with some attribute filtering) since their (more or less) unlikely to cause trouble as long as their properly closed... -- Lasse

« previous php.general (#57464) next »