传递给php的Html属性

传递给php的Html属性,php,Php,在这里,“demo11”的内容可以在index.html中基于id使用innerHtml。在test.php文件中提交表单后,我想获取“demo11”的内容,但我无法获取。请您帮助我 Sample code from index.html file. 它的工作原理更像: <form method = "post" action="test.php" > <table> <tr><td id="demo11"> </td></t

在这里,“demo11”的内容可以在index.html中基于id使用innerHtml。在test.php文件中提交表单后,我想获取“demo11”的内容,但我无法获取。请您帮助我

Sample code from index.html file.

它的工作原理更像:

<form method = "post" action="test.php" >
<table>
<tr><td id="demo11"> </td></tr>
<tr><td><input type="submit"value="Submit"></td></tr>
</table>
</form>


name属性将与输入框中的内容一起传递

也许问题在于没有内容?没有表单元素。HTML内容没有发布到服务器,表单元素键/值对是。提交表单时,
td
元素的内容没有发布。为什么会这样?如果你想检索那里的任何内容,你必须添加一个
input
标记,并将数据放入其中,或者在提交之前使用JavaScript获取数据。此外,你的输入标记需要name属性。
<form method="post" action="test.php">
<table>
<tr><td><input type="text" name="demo11" id="demo11"/> </td></tr>
<tr><td><input type="submit"value="Submit"></td></tr>
</table>
</form>