多条输入的思路,求!!! 块嵌套提取的话在表单中 以明细ID作数组KEY值,POST过来就行了. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 明细输入界面生成很容易,可放在当前页也可放在后续页中明细记录是固定(定长)的时候,可以一次生成明细记录不是固定(不定长)的时候,需要动态生成。动态生成得用js,不再本版的讨论范围里。你可以在javascript版面发贴求解。提取此明细输入信息怎么办?这是关键问题,其实也很简单。只要按二维数组形式命名就可以了测试例<?phpprint_r($_POST);?><form method=post><input type=text name='t[1][]'><input type=text name='t[1][]'><input type=text name='t[1][]'><br><input type=text name='t[2][]'><input type=text name='t[2][]'><input type=text name='t[2][]'><br><input type=submit></form>$_POST数组为Array( [t] => Array ( [1] => Array ( [0] => [1] => [2] => ) [2] => Array ( [0] => [1] => [2] => ) )) <table><tr><td>标题1</td><td>标题2</td></tr><?$exec="select * from aa where bb='cc'";$do=mysql_query($exec);while($rs=mysql_fetch_object($do)){?><tr><td><? echo $rs->a;?></td><td><? echo $rs->b;?></td></tr><?}mysql_free_result($do);?></table><form action="aaa.php" method="post">标题1:<input name="abc" type="text">标题2:<input name="def" type="text"><input type="submit" value="submit></form>而aaa.php就是将提交上来的数据写入数据库,再返回到上面这个页面代码很乱,你看结构好了 想要吧input入库咋办?input为循环出来的。。。 mysql 连接问题 正则置换问题 preg_match_all 看到一好文章 跟大家分享! 简单问题. 提请WEB版版主注意!!!!!!!!!!!!! 怎么样一一定的格式显示数据? 关于PHP的执行顺序问题?困惑大家来讨论 ZendStudio 10 怎么支持php5.5和php5.6 高手帮忙,PHP连接MYSQL的问题 问一个时间的增加或减少的问题。
明细记录是固定(定长)的时候,可以一次生成
明细记录不是固定(不定长)的时候,需要动态生成。
动态生成得用js,不再本版的讨论范围里。你可以在javascript版面发贴求解。
提取此明细输入信息怎么办?
这是关键问题,其实也很简单。只要按二维数组形式命名就可以了
测试例
<?php
print_r($_POST);
?>
<form method=post>
<input type=text name='t[1][]'>
<input type=text name='t[1][]'>
<input type=text name='t[1][]'>
<br>
<input type=text name='t[2][]'>
<input type=text name='t[2][]'>
<input type=text name='t[2][]'>
<br>
<input type=submit>
</form>$_POST数组为
Array
(
[t] => Array
(
[1] => Array
(
[0] =>
[1] =>
[2] =>
) [2] => Array
(
[0] =>
[1] =>
[2] =>
) ))
<?
$exec="select * from aa where bb='cc'";
$do=mysql_query($exec);
while($rs=mysql_fetch_object($do)){
?>
<tr><td><? echo $rs->a;?></td><td><? echo $rs->b;?></td></tr>
<?
}
mysql_free_result($do);
?>
</table>
<form action="aaa.php" method="post">
标题1:<input name="abc" type="text">
标题2:<input name="def" type="text">
<input type="submit" value="submit>
</form>
而aaa.php就是将提交上来的数据写入数据库,再返回到上面这个页面
代码很乱,你看结构好了