dadamssg87 Posted April 7, 2011 Share Posted April 7, 2011 i have this in a form <textarea id='textarea' name='tweet' maxlength=140 > <?php if(isset($_SESSION['description'])) { echo $_SESSION['description'];} ?> </textarea> the session variable is just their input and i use that to repopulate the form if the validation script catches an error with their input. The problem is when the user enters carriage returns and then if theirs an error.... this... "blah blah blah" turns into this... "blah blah\r\n\r\nblah" how do i remove that junk? Quote Link to comment https://forums.phpfreaks.com/topic/232942-translate-carriage-returns-in-textarea/ Share on other sites More sharing options...
btherl Posted April 7, 2011 Share Posted April 7, 2011 That's odd. Do you store the incoming data directly into $_SESSION without any modification? Quote Link to comment https://forums.phpfreaks.com/topic/232942-translate-carriage-returns-in-textarea/#findComment-1198073 Share on other sites More sharing options...
kenrbnsn Posted April 7, 2011 Share Posted April 7, 2011 Are you displaying the value after processing it with the [m]mysql_real_escape_string[\m] function? If so, that is probably the cause of your problem. Ken Quote Link to comment https://forums.phpfreaks.com/topic/232942-translate-carriage-returns-in-textarea/#findComment-1198086 Share on other sites More sharing options...
requinix Posted April 7, 2011 Share Posted April 7, 2011 Are you displaying the value after processing it with the [m]mysql_real_escape_string[\m] function? addcslashes() will do it too. Quote Link to comment https://forums.phpfreaks.com/topic/232942-translate-carriage-returns-in-textarea/#findComment-1198104 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.