garydt Posted October 9, 2007 Share Posted October 9, 2007 I've just made a forum. When entering text into a textarea for a post, i press enter to begin a new line but on viewing the post it puts the message on one single line which i don't want. How can i make it keep record of the user starting new lines like this. Thanks Link to comment https://forums.phpfreaks.com/topic/72482-solved-new-lines-in-forum/ Share on other sites More sharing options...
Orio Posted October 9, 2007 Share Posted October 9, 2007 nl2br() Orio. Link to comment https://forums.phpfreaks.com/topic/72482-solved-new-lines-in-forum/#findComment-365480 Share on other sites More sharing options...
garydt Posted October 9, 2007 Author Share Posted October 9, 2007 Thanks I did - if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $text = $_POST['post']; nl2br($text); $p = preg_replace ($search, $replace, $text); Still no new lines on viewing posts. Link to comment https://forums.phpfreaks.com/topic/72482-solved-new-lines-in-forum/#findComment-365504 Share on other sites More sharing options...
Orio Posted October 9, 2007 Share Posted October 9, 2007 Not nl2br($text); But- $text = nl2br($text); Orio. Link to comment https://forums.phpfreaks.com/topic/72482-solved-new-lines-in-forum/#findComment-365506 Share on other sites More sharing options...
garydt Posted October 9, 2007 Author Share Posted October 9, 2007 thanks alot Link to comment https://forums.phpfreaks.com/topic/72482-solved-new-lines-in-forum/#findComment-365528 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.