Blekk Posted June 11, 2007 Share Posted June 11, 2007 Hi, I have looked through this forum using force, but I couldn't really find anything that was a lot like my problem. I have created a little website for me and my friends working on a project. I have a little message board thing going on, where you just login, enter the subject and message and it is entered into the MySQL database. This works fine, but the message (which is a textarea when inputting data) comes out all on one line with just spaces inbetween words where there should be new lines. I have looked at nl2br, and so have used it to output the data so that: print nl2br($message); as the data in the MySQL field has new lines in it, but this doesn't seem to work. What is the problem? Thanks, Any reply is appreciated. Link to comment https://forums.phpfreaks.com/topic/55122-nl2br-help/ Share on other sites More sharing options...
chigley Posted June 11, 2007 Share Posted June 11, 2007 That should work.. paste more code please. Link to comment https://forums.phpfreaks.com/topic/55122-nl2br-help/#findComment-272497 Share on other sites More sharing options...
suma237 Posted June 12, 2007 Share Posted June 12, 2007 hi, Check this code- nl2br will work <? $msg="gjjljk hjljklk jojl jjlk hojl bjhkjkk hkhkklp hkjljlk bgjhlko ghjhkj hihjlo"; print nl2br($msg); ?> Link to comment https://forums.phpfreaks.com/topic/55122-nl2br-help/#findComment-272993 Share on other sites More sharing options...
chigley Posted June 12, 2007 Share Posted June 12, 2007 Try using <?php when opening your tags, short_tags may be disabled. Link to comment https://forums.phpfreaks.com/topic/55122-nl2br-help/#findComment-273096 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.