我有一個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