文本区域表单以及如何存储数据 [英] Text Area Forms and How Data is Stored

查看:80
本文介绍了文本区域表单以及如何存储数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个html textarea的问题,以及如何在php中解释输入

。例如,在我的新闻帖子中,新行没有被带到




目前这就是我正在做的事情:

makenews.php从makenews.php获取表单数据并将其吐出到名称模板尚未存在的

第一个文件

news.file.I.txt我从0开始向上工作。但是,如果

我输入如下内容:


这是一个测试。在''new''和''line''之间有一个新的

行。


我最后得到一条新闻贴喜欢这是一个考验。在''new''和''line''之间有一个

换行符。


发生了什么事?你可以自己玩这个脚本,如果这有助于

任何,我已经创建了一个供你们使用的副本
http://www.cse.msu.edu/~meyerro3/google.php 。将在一分钟内在该页面上发布源代码

代码。

I''m having problems with an html textarea and how the input is
interpreted in php. For instance, new lines aren''t being carried over
in my news posts.

Currently this is what i''m doing:
makenews.php takes form data from makenews.php and spits it out to the
first file that doesn''t already exist of the name template
news.file.I.txt where I starts at 0 and works its way up. However, if
I enter something like the following:

"this is a test. There is a new
line between the words ''new'' and ''line''"

I end up with a news post that looks like "this is a test. There is a
newline between the words ''new'' and ''line''".

What is going on? You can play with the script yourself if that helps
any, i''ve created a copy for use by you guys at
http://www.cse.msu.edu/~meyerro3/google.php . Will post the source
codes on that page in a minute.

推荐答案

这就是这个这可以帮助你得到你想要的东西。

WYSIWYG .... http://www.htmlarea.com/directory/Detailed/117.html

Rgds,

Gerard

There''s this which could help you get what u want.
WYSIWYG....http://www.htmlarea.com/directory/Detailed/117.html

Rgds,
Gerard


Robizzle写道:

[snip]
Robizzle wrote:
[snip]
这是一个测试。在''new''和''line''之间有一条新的
线。

我最后发布的帖子看起来像是这是一个测试。在''new''和''line''之间有一个
换行符。
"this is a test. There is a new
line between the words ''new'' and ''line''"

I end up with a news post that looks like "this is a test. There is a
newline between the words ''new'' and ''line''".



[snip]


我的猜测是,当你显示

帖子时,你不会将换行符转换为< br>'。如果只有换行符,Html不会显示新行。它需要

a< br>标签。


看看这个:

www.php.net/nl2br

希望它有所帮助。


Zilla。


[snip]

My guess is that you don''t convert newlines to <br>''s when you show the
posts. Html doesn''t show a new line if there is just a newline. It needs
a <br> tag.

Take a look at this:

www.php.net/nl2br

Hope it helps.

Zilla.


Zilla写道:
Robizzle写道:
[snip]
Robizzle wrote:
[snip]
这是一个测试。在''new''和''line''之间有一条新的
线。

我最后发布的帖子看起来像是这是一个测试。在''new''和''line''之间有一个换行符。
"this is a test. There is a new
line between the words ''new'' and ''line''"

I end up with a news post that looks like "this is a test. There is a
newline between the words ''new'' and ''line''".


[snip]

我的猜测是你不要当您显示
帖子时,不要将换行符转换为< br>'s。如果只有换行符,Html不会显示新行。它需要
一个< br>标签。

看看这个:

www.php.net/nl2br

希望有所帮助。


[snip]

My guess is that you don''t convert newlines to <br>''s when you show the
posts. Html doesn''t show a new line if there is just a newline. It needs
a <br> tag.

Take a look at this:

www.php.net/nl2br

Hope it helps.




如果您想要符合HTML 4.01标准,使用:


str_replace(" \ n","< BR>",



If you want to be HTML 4.01 compliant, use:

str_replace("\n", "<BR>",


这篇关于文本区域表单以及如何存储数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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