Re: Paragraph returns
| From: | Toby Butzon | Date: | Thu, 21 Dec 2000 22:07:19 +0000 |
| Subject: | Re: Paragraph returns | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-5396@lists.php.net to get a copy of this message | ||
If I understand correctly, you're trying to make HTML output be formatted
just as it was typed in the textarea box; therefore, we need to replace all
line-breaks in the textarea box ("\n") with breaks or paragraph marks
("<br>" or "<p>", respectively). It's fairly simple; if your
textbox were
named "myText", you'd do this in your PHP (either before display or before
insertion into the database, but make that decision based on if the data may
be needed for other uses; if you're only going to display it on the web,
it's probably best to go on and do the conversion):
$myText = str_replace("\n", "<p>", $myText);
Toby Butzon
[ criticism spurs improvement ]
----- Original Message -----
From: "Lisa Rubanowicz" <info@navanwebdesign.com>
To: <php-db@lists.php.net>
Sent: Thursday, December 21, 2000 4:49 PM
Subject: [PHP-DB] Paragraph returns
: Hi All,
: I hope you can help. I am a total beginner at PHP but am eager to learn.
: I have two pages, very basic at the moment.
: http://www.navanwebdesign.com/in.php which is a
web form sending data to
: a mySQL database.
: On page two http://www.navanwebdesign.com/out.php is a listing
of all
: data entry from page 1.
: Now supposing I wanted to use this so I can update my web site through a
: web form I need to be able to do Paragraph returns <P> like so.
: QUESTION: What do I type in the TEXTAREA box to result in a <P> in the
: output (out.php) which comes from the database. Or do I have to check
: the input in the TEXTAREA box for <P> and replace with something else in
: the PHP code - If so how do I do this.
:
: I have tried several varieties of "\r\n" , in the TEXTAREA box,
: but as I am a beginner I am lost now and it is SOOOO frustrating.
: I would like to thank you for your help in this matter
: Seasons greetings
: all the Best
: Lisa Rubanowicz
: Ireland
:
:
: --
: PHP Database Mailing List (http://www.php.net/)
: To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
: For additional commands, e-mail: php-db-help@lists.php.net
: To contact the list administrators, e-mail: php-list-admin@lists.php.net
:
: