Posted by Dr. No on 01/14/07 00:36
ghostwalker wrote:
> Hi
>
> I have an HTML form with a textarea on it. When submitted (using 'get'
> not 'post') this forms action php file simply does this to retrieve the
> values:
>
> $message = $_GET["message"];
>
> Now it all works fine but I get the string in one long string with no
> '\n' where the user pressed 'return key'
>
> How can I get the carriage returns in the textarea to be replaced with
> a '\n' ??? Its driving me nuts here!!
>
The line breaks should be passed and decoded into the variable without problem.
When you are debugging this, are you just writing the value to the browser? If
so, by default the line breaks will not be rendered if the browser is expecting
HTML. Look at the source code for the output to your browser. You will see line
breaks there.
[Back to original message]
|