dannyluked Posted August 17, 2009 Share Posted August 17, 2009 Hi, I would like to be able to use codes such as and . I think they are called BB codes! To make it clear I will explain... I have a form on the page add.php. I want to be able to write the codes in this form then submit them to a MySQL table. Then on index.php this shows the table results and it is there that I would like the codes to work (e.g. makes the text bold]. How do I do that and also where do I add the information about the codes (which page?)? P.S. I know that the codes need [/THE CODE HERE] but I could not show that! Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted August 17, 2009 Share Posted August 17, 2009 You'll need to use regular expressions (e.g. preg_replace) to replace the tags with <b> and </b> tags respectively. The same applies for other tags. I'm sure if you google, you'll find tutorials/examples/code snippets of this kind of thing anyway. You should replace the bbcode for HTML tags when you display data, not before you insert it into the database. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.