General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 8th, 2003, 04:04 AM
flashjoost flashjoost is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 6 flashjoost User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
BBcode

Hello there,

I'm able now to insert, delete update data in a database (php/mysql). For inserting text I've made a form. All this is behind secure pages.

What I'm looking for is a system (BBcode?) to make the text in my form(textarea) for instance bold, a link, underline etc.
It should be easy to install and to use.

any suggestions? Thanks
Joost

Reply With Quote
  #2  
Old October 9th, 2003, 09:41 AM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 6
I'm not totally sure what you're after but presume you want some kind of tagging system (without allowing html) that can be used to 'mark up' text typed into a textarea.

A simple start to this is to create two arrays, one holding the tags you want to have used in the textareas and the second containing what you want them to be replaced by.

Then the contents of the textarea can be passed through the function str_replace with those two arrays and it'll do all the replacements for you.

Example -

PHP Code:
 $search = array ('*b*''*/b*');
$replace = array ('<b>''</b>');
echo 
str_replace ($search$replace$message); 


Using this method you can create any number of 'emphasis' tags or whatever you like and make a single replacement. If you're more serious about doing this you can hold a list of all of them in a database or textfile rather than hardcoding them then dynamically build the arrays from that.

Hope this helps,

-KM-

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > BBcode


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT