UnknownPlayer Posted February 23, 2011 Share Posted February 23, 2011 Hi, i need help with sending text with new rows(nl2br() func in php). When i do this: xmlhttp.open("GET", "send_post.php?content="+post_text, true); post_text is text with new rows, but in send_post.php i take that variable from $_GET and write that text to mysql, but there are no new rows :S Example text: some text here .. it will write it to mysql like this: sometexthere Link to comment https://forums.phpfreaks.com/topic/228653-help-with-new-rowsnl2br-func-in-php/ Share on other sites More sharing options...
trq Posted February 24, 2011 Share Posted February 24, 2011 nl2br should be used on the way out of a database. You shouldn't manipulate data on the way in. Link to comment https://forums.phpfreaks.com/topic/228653-help-with-new-rowsnl2br-func-in-php/#findComment-1178998 Share on other sites More sharing options...
UnknownPlayer Posted February 26, 2011 Author Share Posted February 26, 2011 I cant use that, i tryed :S But i can use this: var post_text = document.getElementById('commentBox').value.replace(/\n/g,'<br />'); becouse when i send data to php file to write in mysql it recive texti without tags :S Link to comment https://forums.phpfreaks.com/topic/228653-help-with-new-rowsnl2br-func-in-php/#findComment-1180009 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.