On Fri, Jan 31, 2003 at 06:22:50PM +0200, Tarik Kutluca wrote:
> Hi,
>
> >From a web form I am collecting information to a table. On the form there is
> a textarea element storing to a text field on the mysql table. Since the
> textarea can hold the enter key, it's stored in to the field also, but when
> i try to call that cell and display it on the web page, i see that line
> breaks are ignored. But the sentences must be displayed as they are entered.
>
> - what is the stored character code of the enter key in the text field, i am
> figuring out to find that character and replace it with the <br> element,
> for the exact display,
>
> - do you have a shorter way to do this?
When HTML agents display text, they are supposed to fold all
whitespace characters (newlines, tabs, spaces) into a single space
character unless the text is contained in a
<pre></pre> block.
The characters that make up a new line sequence vary depending on
the operating system of the client. Unix-like OSs use ASCII
character code 10, Windows uses 13 followed by 10 and Macs (but
likely not OS X+) use 13.
If you are using PHP, just call nl2br() on the text before you
display the text.
Cheers!
--
Zak Greant <[EMAIL PROTECTED]> | MySQL Advocate | http://zak.fooassociates.com
MySQL Tip: Show the configuration options set in the server
% mysqld --print-defaults
My punctuality is well known. When the revolution takes place, I'll be late
and I'll be shot as a traitor.
--Traitor by the SugarCubes
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php