At 14:00 01/03/2006, you wrote:
Message-ID: <001701c63d38$71e84c30$6501a8c0@shuttlebox>
From: "Jeff Broomall" <news@xxxxxxxxxxx>
To: <php-db@xxxxxxxxxxxxx>
Date: Wed, 1 Mar 2006 09:00:03 -0500
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0014_01C63D0E.87271600"
Subject: Where did my Hard Returns go?
I created an edit_task page that allows the user to edit tasks for the
database. I entered some text and used some hard returns.
But when I went to view the tasks (using a PHP script if it matters),
the hard returns didn't "take." None of em. All of the text is
jumbled together.
I checked within the MySQL database and noticed the Hard Returns
show in the database (at
least while using phpMyAdmin).
Must have something to do with PHP? Where did I go wrong???
No, it must not have something to do with PHP. View the source of
your web page. You'll see those hard returns are recovered verbatim
from the database. Web browsers *only* respect returns (newlines) in
elements formatted as <pre /> or when using a fixed pitch font in CSS.
You need to nl2br($result_string) if you want to get HTML <br />
characters in the stream - browsers use <br /> not newlines to
display line breaks. I thought everybody knew that ;-))
Cheers - Neil
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php