Ask a Question related to PHP Development, Design and Development.
-
william #1
Respecting line breaks?
Hi all,
I'm try to make a forum, in which people can add messages to a
discussion. I use a textarea for input and store this text in a
database. When I read the text from the database and display it with PHP
all the line breaks entered by the sender have disappeared. Can anyone
tell me how to solve this problem?
Thanx,
WJ
william Guest
-
Get rid of uselses line breaks?
Greetings, I noticed when I use design mode on Dreamweaver to input text, I get too many line breaks on the source code. Is there a way to... -
cfmail line breaks
I'm sending text only email via cfmail. I don't seem to have much control over line breaks. Code is: <cfmail ....> (type not specified) Name:... -
Excess Line Breaks
I updated to MX and opened my site up to find it had put in large numbers of empty lines between lines of code... I'm working with .php files and... -
Line Breaks (DB APP)
What server model are you using? ASP? PHP? CF? -- Dave ----------------------------------------------------------------- If I were half as... -
How to insert line breaks using SQL
I would try using a true CR+LF pair, e.g. CHAR(13)+CHAR(10) -- Aaron Bertrand, SQL Server MVP http://www.aspfaq.com/ Please reply in the... -
Jonny #2
Re: Respecting line breaks?
Try using the <pre></pre> tags around the outputted text.
"william" <wjz@wirehub.nl> wrote in message
news:WdmAc.2800$D67.769@amsnews02.chello.com...> Hi all,
>
> I'm try to make a forum, in which people can add messages to a
> discussion. I use a textarea for input and store this text in a
> database. When I read the text from the database and display it with PHP
> all the line breaks entered by the sender have disappeared. Can anyone
> tell me how to solve this problem?
>
> Thanx,
> WJ
>
Jonny Guest
-
Andy Barfield #3
Re: Respecting line breaks?
william wrote:
You need to replace textual line breaks with html line breaks -> Hi all,
>
> I'm try to make a forum, in which people can add messages to a
> discussion. I use a textarea for input and store this text in a
> database. When I read the text from the database and display it with PHP
> all the line breaks entered by the sender have disappeared. Can anyone
> tell me how to solve this problem?
>
> Thanx,
> WJ
>
[url]http://uk.php.net/manual/en/function.nl2br.php[/url]
Regards,
Andy
Andy Barfield Guest
-
eclipsboi #4
Re: Respecting line breaks?
You have to understand one thing about HTML. Unless the line breaks
are either a) Placed inside of <pre></pre> tags or b) replaced with
either <br> or <p>, they are ignored. Similar to how most line breaks,
and whitespace, is ignored in PHP. Like in some other posts, you could
simply use nl2br() to convert the line breaks from your user's input
into <br> tags.
On Thu, 17 Jun 2004 19:24:38 GMT, william <wjz@wirehub.nl> wrote:
>Hi all,
>
>I'm try to make a forum, in which people can add messages to a
>discussion. I use a textarea for input and store this text in a
>database. When I read the text from the database and display it with PHP
> all the line breaks entered by the sender have disappeared. Can anyone
>tell me how to solve this problem?
>
>Thanx,
>WJeclipsboi Guest



Reply With Quote

