The problem is if the user enters something like this:
Hello, how are you?
In the div, this text is displayed as:
Hello, how are you? From, Zack
I don't want this, I want it to be displayed as the user entered (just like a forum post here on this site). So, I'm assuming what I have to do is replace when a user hit enter with a <br/>. How would I do something like this? Do textareas store this as something that I can just do a replace?
Thanks for the help!
Also, is there anything I should be hesitant about? Like, a user could enter html into this textarea and it would completely change my site. Is there a way to prevent this?<---EDIT: Used strip_tags()
$_POST['postInput'] = str_replace("<br>", "\n", $_POST['postInput']);
But that doesn't work. It seems textareas don't capture pressing enter as \n?
This post has been edited by eZACKe: 04 July 2011 - 02:20 PM