Page 1 of 1

how to recognise line breaks or html SOLVED

Posted: Wed Nov 22, 2006 11:11 am
by mikeeeeeeey
hey guys, hope your all having a good week so far.

Just wondering if anyone can help, I'm building a pretty big CMS and the time has come to populate the database with content.


Just tried to do it with my own backend by putting text into a textarea box, and putting in line breaks between content

like

on

here.

But it won't recognise them!
If I look at the page where it should be displayed, everything it just crammed into one huge chunk on text :(
I've had a look aswell and theres some bulleted lists laying in wait, so I think I could do with finding out how to use html (or even just putting in line breaks).



Any help much appreciated, thanks in advance :D

Posted: Wed Nov 22, 2006 11:29 am
by mattbee
Hey,

I am pretty newish to php, so may be corrected later on, but I'll try to help.

You should be able to rectify the problem using the

Code: Select all

nl2br()
function in php. See http://uk.php.net/manual/en/function.nl2br.php for implementation.

Alternatively, you could implement tinyFCK, a cross browser javascript text editor, which I use regularly. Once you've got to grips with the configuration, it's really flexible, and really useful. I'd recommend getting rid of unnecessary files for a reduced file size once you've got it though (but that's just me). See http://p4a.sourceforge.net/tinyfck for download.

Hope some of that was useful.

Matt

Posted: Wed Nov 22, 2006 11:34 am
by Luke
I like tinyMCE

Posted: Wed Nov 22, 2006 11:35 am
by mikeeeeeeey
ahh Ive sorted it, but thanks anyway. I've checked out that function in the manual and it looks like a good solution.

Thanks again

Posted: Wed Nov 22, 2006 11:37 am
by mattbee
The Ninja Space Goat wrote:I like tinyMCE
TinyFCK *is* tinyMCE, but with the upload functionality of FCKeditor (which isn't Safari compatible yet). I too like tinyMCE!! When I don't need file uploads that is.

Posted: Wed Nov 22, 2006 11:44 am
by Luke
oh i see