Forum Moderators: coopster
$note = $_POST["note"];
\r = Mac carriage return
\n = Unix linefeed
\r\n = Windows/DOS LineBreak
in other words, your $_POST array will contain both mac and unix linefeeds. If they got sent, they will be there at the receiving end of the $_POST, too, syat. The trouble probably lies in what's happening to the string at one end or the other, in the scripts, somehow stripping the linebreaks off. some code?
to find out which end the trouble's at, begin (the script) by checking the incoming $_POST array with
$string = print_r($_POST, true);, send that to a text file [webmasterworld.com], open in any decent text editor and you'll see if there's linebreaks. or echo it out between some <pre></pre> tags perhaps.. echo '<pre>',print_r($_POST),'</pre>'; ;o)
(or
Array
(
[user] => tester
[note] => this is a
new line
[submit] => Submit
)
<div class="message" align="left"><h5>ID: 9 ¦ tester 30.05.04, 12:14:05</h5>
<hr/><p>
this is a new line
</p>
</div>
str_replace("\r",'<br>',$string);
;o)
(or