You are here: Re: Where did my Hard Returns go? « PHP Programming Language « IT news, forums, messages
Re: Where did my Hard Returns go?

Posted by Jerry Stuckle on 03/01/06 16:23

ward@ wrote:
> David, thank you for asking.
>
> I'm using MSIE 6.x to view.
>
> I'm not sure if we're on the same page. I know about using <BR> and
> <br/> within the browser (if we're talking about the same thing) but
> it's the output from the database that isn't working. Somehere
> between the database and output using PHP I loose the hard returns.
>
> For example, if I was to enter...
>
> Topic A
>
> Now is the time for all men
>
> to come to the aid of their nation.
>
> That's who it would show up in the database, but trying to output it
> into my page it'll look like...
>
> Topic A Now is the time for all men to
> come to the aid of their nation.
>
> I hope that helps.
>
> Ward
>
>
> On Wed, 01 Mar 2006 09:05:09 -0500, David Haynes
> <david.haynes2@sympatico.ca> wrote:
>
>
>>ward@ wrote:
>>
>>>Good morning.
>>>
>>>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.
>>>
>>>Put 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.
>>>
>>>Well I checked within the MySQL database just now (before uploading
>>>this message) 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???
>>>
>>>Thanks.
>>>
>>>--Ward
>>
>>What are you using to view the data? A browser or a terminal session?
>>If a browser, are your 'hard returns' coded as <br> or <br/>?
>>If a terminal session, are your 'hard returns' coded as \r\n or just \n?
>>
>>-david-

Ward,

Look at the source code for your page. You'll see your newlines there.
And the browser is completely free to ignore them.

If you want newline characters, you need to use <br>. Check out nl2br().

--
==================
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

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