You are here: Re: new lines in form « PHP Programming Language « IT news, forums, messages
Re: new lines in form

Posted by Jerry Stuckle on 10/25/05 15:48

Ja NE wrote:
> well, it is time for some fine tuning of my application, after adding
> that banner script for which I needed percentage solution, I would like
> to fix my forum scripts...
> when someone write some text in form's textarea and then
> enter
> new line (btw, is that \r or \n or combination?) I'm not "getting" that
> new line but space. what can I do to "recieve" and store (in mysql db)
> text with newlines instead of spaces. and, even better, to replace that
> newline with </p>\n<p>...
>
> tnx again
>

Jane,

That's the way HTML works - if you look at the page source and you'll
see the newlines in there. But processing the HTML gets rid of them.

You need to use something like PHP's nl2br() function to convert newline
characters to html breaks.

It can get very confusing when a newline "isn't" a newline!


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация