ShoeLace1291 Posted October 9, 2007 Share Posted October 9, 2007 I have a script that lets uers enter a message into a textarea. My problem is that if a user wants to start a new line or press the enter/return button, it doesn't display it in the message. For example, my basic forum software I'm making for my website lets users add threads. A user posts a message with a request that viewers follow a certain link and says they'll post the link below. He doesn't want the link to appear on the same line as the general message so he hits enter or return. Now when a user views the message, the link still appears on the same line. How would I make the return/enter button actually insert the <br> tag into the message? Quote Link to comment https://forums.phpfreaks.com/topic/72532-solved-replace-return-with/ Share on other sites More sharing options...
AndyB Posted October 9, 2007 Share Posted October 9, 2007 Use the nl2br() function on the output (display) data. Quote Link to comment https://forums.phpfreaks.com/topic/72532-solved-replace-return-with/#findComment-365716 Share on other sites More sharing options...
ShoeLace1291 Posted October 9, 2007 Author Share Posted October 9, 2007 Sweet thanks. Quote Link to comment https://forums.phpfreaks.com/topic/72532-solved-replace-return-with/#findComment-365718 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.