graham23s Posted May 8, 2007 Share Posted May 8, 2007 Hi Guys, i have noticed that when a user is typing in a form, when they do a line break line 1 line 2 line 3 it displays as line 1rn line 2rn line 3rn, i did this: $comments = mysql_real_escape_string($_POST["comments"]); $comments = stripslashes($comments); not sure if i have done that right it stll displays the same and advice would be great cheers Graham Quote Link to comment https://forums.phpfreaks.com/topic/50471-solved-line-breaks-in-forms-as-rn/ Share on other sites More sharing options...
Thierry Posted May 8, 2007 Share Posted May 8, 2007 Hmm, a newline is made with \r\n, I'm geussing that you are removing the slashes from it. For textareas and such, \r\n is used, but for showing it otherwise you can use <br>. Try: $comments = str_replace("\r\n","<br>"); Quote Link to comment https://forums.phpfreaks.com/topic/50471-solved-line-breaks-in-forms-as-rn/#findComment-247979 Share on other sites More sharing options...
igor berger Posted May 8, 2007 Share Posted May 8, 2007 Try this nl2br($my_data) Please take care of my conulting bill before the closing day of the end of the month. The consultantion charge is .01 Thank you for shopping with us! Quote Link to comment https://forums.phpfreaks.com/topic/50471-solved-line-breaks-in-forms-as-rn/#findComment-247984 Share on other sites More sharing options...
graham23s Posted May 8, 2007 Author Share Posted May 8, 2007 thanks guys solved:) Quote Link to comment https://forums.phpfreaks.com/topic/50471-solved-line-breaks-in-forms-as-rn/#findComment-248010 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.