You are here: Re: trouble formatting text « PHP Programming Language « IT news, forums, messages
Re: trouble formatting text

Posted by Michael Fesser on 12/21/07 21:06

..oO(Rozzy)

>Hi, I'm having trouble using the proper terminology, so bear with me,
>I am trying to submit text to a mysql database. I want to be able to
>allow formatting of this content (like breaking it up into
>paragraphs). I am sending the data to the server via ajax, and so
>escape the characters.
>
>When I read back the information on my news page, all of the
>formatting is gone. Do I need to unescape the charachters somehow
>using javascript or php?

If the text was entered in a text area for example, then of course it
only contains normal line breaks. If you want to print it out as HTML,
then you either have to call nl2br() (be aware that it returns XHTML)
or - better - replace the line breaks with proper 'p' elements.

Micha

 

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

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