Jump to content

Recommended Posts

I am trying to incorporate a code tag into my website like they user here. People are going to be able to make posts like they can here and I want a button that they can use to input the code. The data is going to get inserted into the database. Then I want to display it back with the code tags in the code blocks with the highlighting. I am creating tutorials for php coding which is why I want the code blocks. Any tutorials or help is appreciated. I know that you can use:

 

highlight_string($string);

 

The problem is trying to get it to work with the textbox and having it put into the database. Any help or point in the right direction would be great.

Link to comment
https://forums.phpfreaks.com/topic/131244-solved-using-tags/
Share on other sites

I have used your code and it works perfectly. Thank you for that. i have 2 more quick questions though. I want a select button above the box where the code is inserted. How would I accomplish this? Also how can I make a button for the code tags to insert [c0de] and [/c0de] in a textbox. Like how when you click the # it puts it where you are typing on this website.  Thanks for any help.

Link to comment
https://forums.phpfreaks.com/topic/131244-solved-using-tags/#findComment-681427
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.