Jump to content

How to add BBCode...


dannyluked

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.