【发布时间】:2019-05-29 04:27:51
【问题描述】:
我有一个这样写的 html 列表:
<form action="check.php" style="display:none" method="post">
<h1 class="text-center">your items are</h1>
<ul id="riepilogo" name="riepilogo">
<br/>
<li name="">first item</li>
<li name="">second item</li>
<li name="">third item</li>
...
</ul>
<input type="submit" value="Pay" id="pay"/>
</form>
这段代码写在一个html页面中,现在的问题是我不知道如何使用php在新页面中显示所有这些项目。我认为也许我需要为列表中的所有项目设置相同的名称,然后将它们存储在 php 数组中。我真的不知道!也许它不能用php,我真的不知道。 感谢丹尼尔的帮助
【问题讨论】:
-
您的 html 无效 -
<ul>和<h1>99% 的时间不应包含在<form>中 -
可以查看这个问题的答案Pass form data to another page with php
-
@treyBake 在
<form>中使用<ul>在技术上是完全有效的,所以不要另外声明。它不会发布数据,但这不会使其成为无效的 html。 -
@PeterB 啊,是的,抱歉,我认为我使用了错误的术语!我的意思是,它是不正确的语义 - 不是无效的HTML
-
@PeterB 或者我脑子里有一个印象,那就是做 xD 是 100% 不正确的
标签: html