You are here: Re: Line breaks (\n) from a html form textarea??? HELP! « PHP Programming Language « IT news, forums, messages
Re: Line breaks (\n) from a html form textarea??? HELP!

Posted by Jerry Stuckle on 01/15/07 14:13

Daz wrote:
> Jerry Stuckle wrote:
>
>
>>Daz wrote:
>>
>>>Tim Roberts wrote:
>>>
>>>
>>>>"Daz" <cutenfuzzy@gmail.com> wrote:
>>>>
>>>>
>>>>>Is there any particular reason that you aren't using POST? Generally,
>>>>>GET is for getting data, and POST is for posting. Also, I believe that
>>>>>post encodes and escapes the data, too, so it will arrive as you'd
>>>>>expect it to.
>>>>
>>>>This is not true. GET and POST requests are both encoded, although they
>>>>use different schemes. With the exception of file uploads, there is
>>>>nothing you can send with POST that you cannot also send with GET.
>>>
>>>What I meant by encoded, was encrypted, I think I just chose the wrong
>>>word. I believe that POST requests are encrypted, whereas GET requests
>>>are simply just encoded into URL format.
>>>
>>
>>Nope. POST requests are sent plain text. No encoding/encrypting at all.
>>
>>
>>>>HOWEVER, just because one can, doesn't mean one should. Your basic advice
>>>>is correct: POST should almost always be used for forms, because the URLs
>>>>get too large.
>>>>
>>>>
>>>>
>>>>>My guess is that there is not URL code for the newline
>>>>>chracter, as it's a control code, and not meant to be visible.
>>>>
>>>>
>>>>Nope. That's not the problem. Another responder nailed it: you have to
>>>>tell the <textarea> that you want the newlines by saying <textarea
>>>>wrap="hard">. Otherwise, it assumes you don't want the newlines at all,
>>>>and discards them.
>>>
>>>Well, it was just a guess (as stated). But that is a useful piece of
>>>information to know of, and I was totally unaware of it. I personally
>>>feel it would have been better the other way round, wrap="hard" by
>>>default, as I think it's unlikely that you want the data in any format
>>>other than the format is was entered. Many, many thanks for your input.
>>>
>>>Daz.
>>>
>>
>>No, I typically do not want the nl chars in the input data. That's
>>because I'm going to generally reformat it for display, anyway.
>>
>>
>>>>--
>>>>Tim Roberts, timr@probo.com
>>>>Providenza & Boekelheide, Inc.
>>>
>>>
>
> I guess it depends on what you want to use the text for. I personally
> can't imagine how or why you'd want to strip them. My personal
> prefrerence would be to strip them server side if it was needed, which
> would probably allow me to replace them with something else, or format
> the data more meaningully. Saying that, I haven't been doing this for
> as long as you, so I suppose it's just a question of time and
> experience.
>
> Thank you for your input. :)
>

Because HTML is a fluid mechanism, and you can't control the looks of
the page. All you can do is recommend it.

The way to do it is to get rid of the nl chars and let HTML and CSS do
their own formatting.


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


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

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