adam84 Posted August 10, 2007 Share Posted August 10, 2007 I dont know if this would be a php,html or mysql question, so i tried here furst. I have a textarea where the user enters whatever. Once the user is done, he/she clicks the send button and through ajax the textarea value gets sent to the php file to be process. The problem is: Say the user enters this in the textarea Hello World! This is a test! I insert that value into my db. But when I retrieve the value the carriage return is not there. I looks like this: Hello World!This is a test! What is the problem Quote Link to comment Share on other sites More sharing options...
Oldiesmann Posted August 10, 2007 Share Posted August 10, 2007 Make sure you're either replacing the line breaks with <br /> (PHP's nl2br() function will do this), or that you're using double quotes around the value: echo '\n'; - literally displays \n echo "\n"; - outputs a linebreak 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.