[thelist] Whitespace, mysql, php, IE<7.0

Jon Molesa rjmolesa at consoltec.net
Fri Jan 19 06:05:02 CST 2007


Mark, 
	This is where my line of thinking keeps leading me as well.  The
content in question is being entered into a textarea.  It's entered into
a text field in the db.  I wasn't aware of the nl2br() which just
guessing looks like new line to break.  This could just work.  I'll try
it in the next couple of days and report back.  I'm in the middle of
another project at the moment.

	I'm still not sure why FF would display the extracted data as
entered, and Explorer removes all formatting.  However IE7 will display
it as entered with quite a bit of CSS.  So there does seem to be some
browser issue.  If a "tab" is entered into textarea FF will display a
tab yet IE<7 will not.  It's stripping all formatting.

	Thanks for the function.  I will try it ASAP.  I think I will also
go back through the flow of data and types.  I may try just outputting
the content to the terminal to see how it comes out prior to any browser
getting their hands on it.  I seem to remember during early debugging
that if it were output to another textarea rather than the page, it
would display properly in both browsers.

	My mind wonders down the awful path of testing each character and
replacing tabs, and returns with /n and /t.  This does not appeal to me
and I would think could be a constant source of pain.  LOL.  Thanks all
for the suggestions.  I will report back after some more testing.

* Mark Groen <evolt at markgroen.com> wrote:

> On Thursday 18 January 2007 11:52, Jon Molesa wrote:
> > .........
> > ...........displays the
> > retrieved content unformatted and as one long continuous line.  No
> > breaks, no returns, no tabs, nothing.  It took quit a bit of CSS just to
> > get it to wrap properly.  I'm almost certain that it has something to
> > with the way MySQL/PHP treat data vs. MS Explorer.
> 
> I'm not so sure this is a browser issue, but rather of data in/out. Ensure 
> your form elements are the correct ones for the job. If it is a string of 
> characters like a phone number or name, of course use the type=text input 
> element because you want it all on one line anyways.
> 
> Otherwise, use a textarea element instead. Upon retrieval, use the built in 
> nl2br() function and it will look the same coming out as going in.
> 
> echo nl2br($row['a_paragraph']); 
> 
> --
> cheers,
> 
> 	Mark
> -- 
> cheers,
> 
>         mark
> -- 
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester 
> and archives of thelist go to: http://lists.evolt.org 
> Workers of the Web, evolt ! 

-- 
Jon Molesa
Owner - Consoltec
336.844.4104
828.994.2067
866.433.0835
rjmolesa at consoltec.net
http://www.consoltec.net



More information about the thelist mailing list