【发布时间】:2013-03-19 18:16:06
【问题描述】:
我正在尝试将 html 表行保存到 php 数组中,然后将数组保存在数据库中。
<form action="" method="post">
<table class="widefat" id="theTable">
<thead>
<tr>
<th>Level Identifier</th>
<th>Non-logged in message</th>
<th>Logged in message</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="text" value="" style="height: 19px;background-color: white;font-size:10px;"/></td>
<td><textarea style="font-size:10px;" name="promo_msg_free" cols="43" rows="1">This is your custom message template</textarea></td>
<td><textarea style="font-size:10px;" name="promo_msg_free" cols="43" rows="1">This is your custom message template</textarea></td>
</tr>
<tr>
<td><input type="text" value="" style="height: 19px;background-color: white;font-size:10px;"/></td>
<td><textarea style="font-size:10px;" name="promo_msg_free" cols="43" rows="1"></textarea></td>
<td><textarea style="font-size:10px;" name="promo_msg_free" cols="43" rows="1"></textarea></td>
</tr>
</tbody>
</table>
</form>
如何检索每一行数据并将其保存到数组元素,最后我将数组保存到数据库?谢谢
【问题讨论】:
-
到目前为止您尝试过什么?是否尝试过解析 HTML?是否尝试写入数据库?什么样的数据库?您喜欢/可以使用的任何库?
-
你的问题不清楚。您要保存每个表格行的值,还是只保存输入和文本区域中的值?
-
为什么你首先要使用表格来布局表单元素?使用 div/css
-
行将是动态的。这就是我想要完成的:screencast.com/t/0T3I9jglD4K
-
投票结束了这个问题——它确实没有提供足够的信息来说明 OP 的具体需求,或者他已经尝试过什么,而且过于开放。
标签: php html html-parsing php-parser