ngreenwood6 Posted November 3, 2008 Share Posted November 3, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/131244-solved-using-tags/ Share on other sites More sharing options...
wildteen88 Posted November 3, 2008 Share Posted November 3, 2008 Have a look at this post. Download the .txt file rename to .php and test out the code. Quote Link to comment https://forums.phpfreaks.com/topic/131244-solved-using-tags/#findComment-681403 Share on other sites More sharing options...
ngreenwood6 Posted November 3, 2008 Author Share Posted November 3, 2008 thanks for the code. I will give that a shot. Quote Link to comment https://forums.phpfreaks.com/topic/131244-solved-using-tags/#findComment-681419 Share on other sites More sharing options...
ngreenwood6 Posted November 3, 2008 Author Share Posted November 3, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/131244-solved-using-tags/#findComment-681427 Share on other sites More sharing options...
DarkWater Posted November 3, 2008 Share Posted November 3, 2008 Javascript. Quote Link to comment https://forums.phpfreaks.com/topic/131244-solved-using-tags/#findComment-681497 Share on other sites More sharing options...
ngreenwood6 Posted November 3, 2008 Author Share Posted November 3, 2008 Yeah, I did some research and figured out it would be javascript. I opened another thread so I will close this one. thanks for the help tho Quote Link to comment https://forums.phpfreaks.com/topic/131244-solved-using-tags/#findComment-681501 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.