how to recognise line breaks or html SOLVED

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mikeeeeeeey
Forum Contributor
Posts: 130
Joined: Mon Jul 03, 2006 4:17 am
Location: Huddersfield, UK

how to recognise line breaks or html SOLVED

Post 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
Last edited by mikeeeeeeey on Wed Nov 22, 2006 11:36 am, edited 1 time in total.
mattbee
Forum Newbie
Posts: 4
Joined: Wed Nov 22, 2006 11:17 am

Post 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
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

I like tinyMCE
User avatar
mikeeeeeeey
Forum Contributor
Posts: 130
Joined: Mon Jul 03, 2006 4:17 am
Location: Huddersfield, UK

Post 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
mattbee
Forum Newbie
Posts: 4
Joined: Wed Nov 22, 2006 11:17 am

Post 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.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

oh i see
Post Reply