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 Quote Link to comment 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. Quote Link to comment 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 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.