...

View Full Version : Allow BBCode but Not HTML



UrbanTwitch
09-18-2009, 03:54 AM
OK, so I got a problem. I want my users to be able to post BBCode in their message but NOT html.
How do I do this?

I can't use htmlentities because then they can't use things like quotes or emotions.

Help?

zactanaz
09-18-2009, 05:08 AM
For something simple use strip_tags() function.



$clean = strip_tags($_POST['comment']);


http://us3.php.net/manual/en/function.strip-tags.php

SKDevelopment
09-18-2009, 11:06 AM
PEAR has the BBCode Parser (http://pear.php.net/package/HTML_BBCodeParser/download) ... At least it could be worth looking at it I think.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum