This Message Forum is no longer in use

Please use the new Bravenet Help Forums FOUND HERE

General Forum
This Forum is Locked
Author
Comment
View Entire Thread
Re: how do i add bbcode

Your error comes from these two lines:
$yourpost = $_POST['txt_post'];
$yourpost = bbcode($the_post);
Notice that the variable containing the post is $yourpost, but the one you're trying to bbcode is $the_post. Since $the_post is not set anywhere it counts as an empty string. Just change $the_post to $yourpost and it should work.

Browser: Mozilla Firefox 3.6.*

OS: Windows 7

Re: how do i add bbcode

Thanks for the help

Browser: IE7

Re: how do i add bbcode

ok to get it to work i had to get rid of strip tags is there a way to get it to work were people can still use [ these ] those but still get rid of html code?

Browser: IE 7

Re: how do i add bbcode

I wouldn't have thought that strip_tags would strip bbcode, but you could try replacing it with htmlspecialchars() instead. Only problem with that is someone could probably insert on click events etc. into the bbcode tags and they wouldn't get removed, allowing users to run whatever javascript they wanted. Twitter had a lot of problems with this recently.

Browser: Mozilla Firefox 3.6.*

OS: Windows 7