在帖子上失去领先空白 [英] losing leading blank line on posts

查看:55
本文介绍了在帖子上失去领先空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我发现如果我输入的文字是

< textarea ...> < / textarea的>在一个表单中,那个文本

有空白行(没有空格或任何东西,或者是b $ b),当我检索输入的文本时,我

失去领先的空白行。每次通过

邮寄任何顶级空白行都会丢失。只有一个 -

如果我在顶部连续有几行空白,

只有第一个丢失了。 (如果顶部的空白行有一个空格,那么它的处理是正确的。)


这是正常的吗?当我检索时,会使用htmlentities

吗?没有其他空白行,无论是在中间还是在结尾的



我希望有一些解决方法。任何帮助都非常好

赞赏,

-dg

解决方案

dan glenn写道:

嗨。我发现如果我输入的文字是
< textarea ...> < / textarea的>在一个表单中,该文本
具有前导空行(没有空格或其他任何其他内容),当我检索输入的文本时,我将丢失前导空行。



真的迷路吗?您是否正在使用浏览器的演示文稿

来检查数据?如果是这样,请检查实际数据。


-

Jock



" John Dunlop" <乔********* @ johndunlop.info>在消息中写道

新闻:MP ************************ @ News.Individual.NE T ...

dan glenn写道:

嗨。我发现如果我输入的文字是
< textarea ...> < / textarea的>在一个表单中,该文本
具有前导空行(没有空格或其他任何其他内容),当我检索输入的文本时,我将丢失前导空行。


它真的迷路了?您是否正在使用浏览器的演示文稿来检查数据?如果是这样,请检查实际数据。

-
Jock




是的,Jock,它似乎真的得到了丢失。请尝试以下方法:


文件:testtextarea.php

<?php

if(isset(

< br>

_POST [''t_textarea''])){


Hi. I''m finding that if I have text entered into a
<textarea ...> </textarea> in a form, and that text
has leading blank lines (with no spaces or anything
else), that when I retrieve the entered text, I
lose the leading blank line. Each time it goes through
a post any top-leading blank line is lost. Only one-
if I have several blank lines in a row at the top,
only the first is lost. (If the top blank line has
a single space, it''s handled properly).

Is this normal? When I retrieve, would using htmlentities
to this? No other blank lines are effected, whether in
the middle or the end.

I hope there''s some way around this. Any help greatly
appreciated,
-dg

解决方案

dan glenn wrote:

Hi. I''m finding that if I have text entered into a
<textarea ...> </textarea> in a form, and that text
has leading blank lines (with no spaces or anything
else), that when I retrieve the entered text, I
lose the leading blank line.



Is it really getting lost? Are you using your browser''s presentation
of the data to check this? If so, check the actual data instead.

--
Jock



"John Dunlop" <jo*********@johndunlop.info> wrote in message
news:MP************************@News.Individual.NE T...

dan glenn wrote:

Hi. I''m finding that if I have text entered into a
<textarea ...> </textarea> in a form, and that text
has leading blank lines (with no spaces or anything
else), that when I retrieve the entered text, I
lose the leading blank line.



Is it really getting lost? Are you using your browser''s presentation
of the data to check this? If so, check the actual data instead.

--
Jock



Yes, Jock, it seems to really be getting lost. Try the following:

file: testtextarea.php
<?php
if (isset(


_POST[''t_textarea''])) {


这篇关于在帖子上失去领先空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆