I am having a problem with some textarea things. I insert text into my database using a textarea like
<textarea id="e1" name="content"></textarea>
My php file then runs some stuff on it as shown to make HTML tags out of \n and \r:
$str = $_POST['content'];
$order = array("\r\n", "\n", "\r");
$replace = '<br />';
$content = mysql_real_escape_string(str_replace($order, $replace, $str));
and the result gets inserted into a database.
I then call the result from the database in $content and put that in a text area like so:
<textarea id="e1" name="content"><?php echo $content ?></textarea>
When I view that page the <br /> tags are visible.
An Example:
I submit this into the text area
Hello,
This is text.
Best Rergards,
Testificus
It gets processed by my php code and then is echoed into the textarea. When it is echoed into the textarea it comes out in the form:
Hello,<br />This is text.<br />Best Regards,<br />Testificus
Is there any way of having the text look like before with the <br /> tags in action rather that being presented as text? Thanks for your help and let me know if it is not clear what I mean.