There are two ways to do this. The first is to take a post and convert it from bbcode into html before entering it into the database. The second is to store the bbcode in the database. The second way is to store the bbcode in the database and convert it before it is displayed each time. The first way is by far the easiest since it just requires one function call.
/* Now when you insert the values into the database use $the_post for the post content /*
If you don't know much about PHP then something as complex as a forum can be dangerous, especially if you didn't write the code yourself.
I would suggest you go and find some PHP tutorials, and when you have enough knowledge to write a forum then you're in a much better position to make sure the code is safe to use.
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.
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?
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.