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? 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? 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 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. 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
Archived
This topic is now archived and is closed to further replies.