我有一个php数组元素想要提交作为POST值,但它只接受由于间距的第一个单词。下面是我的源代码:如何将包含空格的php变量存储到html变量中?
<input type="number" class="form-control" placeholder="Please enter the amount to order" size="5" name='.$row["fname"].' />
当页面打印它显示为:
<input type="number" class="form-control" placeholder="Please enter the amount to order" size="5" name=Mussel in Chill Sauce />
正如你所看到的,只有两个字“贻贝”被存储到HTML表单的name
变量。我如何储存全文“辣椒酱中的贻贝”,它源于我的$row["fname"]
?
感谢您的帮助感谢
内'NAME = “ '$行[ ”FNAME“]。'”/ >''。或者用'printf()'代替。另外,顺便说一下,'name'是一个*属性*,不是HTML变量。 HTML没有变量。 – 2014-11-05 12:55:39
[HTML5占位符属性不能代替标签元素](http://www.456bereastreet.com/archive/201204/the_html5_placeholder_attribute_is_not_a_substitute_for_the_label_element/) – Quentin 2014-11-05 12:56:34
name是HTML标签的属性。 HTML中的所有属性均应使用双引号。 – newman 2014-11-05 12:59:26