I am creating a user input interface (similar to this vB post box I’m typing in now), but am not sure of the best way to handle HTML input.
I would like to allow users the opportunity to use some formating tags, such as <em>, <strong>, <a>, and <blockquote>, and can accomplish this using:
[code=php]$Text = strip_tags($Text, ‘<em><strong><blockquote><a>’);
But how do I ensure that any opened tags are closed after a user’s post, and can’t be left open and “bleed” onto the rest of the page?
I could close the above tags just in case like:
[code=php]$Text .= “nr</em></strong></a></blockquote>”;
but that isn’t [I]really
How does vB / PHPBB (and others) handle this? Or what’s the best way of ensuring that open user-allowed tags get closed?
Thanks for everything,
Nick