\n --> <br> how do i replace all of this??<

liunx

Guest
if you post a thread you get a MAGNIFICENT example of what i want to get.

if you press 'enter' (\n) it gets replaced by <br>
and there are much more examples.

how do i disable html (cuz i don't want bozo's messing up my site) but i want to be able to give them the possiblity of using bold letter also Italic/underlined and much more.

could somebody give me a 'pefect school example' of this so i can modify it like i want to?

thx for readingBut what situation are you talking about? On a forum like this? I guess you can only do that through the control panel settings, either that or you have to find the config files and modify the php script that handles \n and stuff. Manually edit the code to filter.\n to <br>
nl2br()

to disable any html input
strip_tags()

to be able to have bold and all others, you have multiple choice, here it's called bbcode if i remember correctly
can be done with
preg_replace()to replace \r or \n
str_replace("\r\n|\r|\n", "<br />", $posted_message_var); or the nl2br()

to do bbcode you will need to use regular expressions.

to turn of html
str_replace(">", ">", $posted_message_var);
str_replace("<", "<", $posted_message_var);to turn of html
str_replace(">", ">", $posted_message_var);
str_replace("<", "<", $posted_message_var);


or htmlentities
(i did forgot about that one...)seems I did too :)thx all for your help!
 
Top