faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 7 people (29%) answered Yes
Recently 2 of 7 people (29%) answered Yes

Entry

Formatting User's Input

Feb 23rd, 2007 23:12
PHP Man, Wise One,


i hav a form which has textarea. My user input their texts like this 
bla bla bla bla bla bla.....
[BIBLE]"But when you give to the needy, do not let your left hand know
what your right hand is doing." (Matthew 6:3)[/BIBLE]
bla bla bla bla bla bla....
Now wat i wan is 
1. Find [BIBLE] & [/BIBLE] tag from the users input 
2. remove the [BIBLE] & [/BIBLE] tag 
3. just format whatever is in between those tags. Make bold & red
color => text inside double quotes. Make italic & blue => text inside
curly brackets.
My final html code shld b like this
bla bla bla bla bla bla.....
"<font color=#FF0000><b>But when you give to the needy, do not let
your left hand know what your right hand is doing.</b></font>" (<font
color=#0000FF><i>Matthew 6:3</i></font>)
bla bla bla bla bla bla....
i need a function which automatically check for the presence of
[BIBLE]...[/BIBLE], if found do rest of the formatting... is it
possible?????
ne 1 can help me pls???
thnx
=======
planetpdf.com/developer/article.asp?
ContentID=slicing_and_dicing_formattin&gid=6306
hope that helps.
http://americanahost.com
http://www.qwesz.com