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 Quote Link to comment Share on other sites More sharing options...
Orio Posted October 9, 2007 Share Posted October 9, 2007 nl2br() Orio. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
garydt Posted October 9, 2007 Author Share Posted October 9, 2007 thanks alot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.