日期:2014-05-17 浏览次数:20536 次
echo "<form name=\"form1\" method=\"post\" action=\"process.php\"><table border='1' id=\"oTable\">
<tr>
<td>文件名</td>
<td>文件大小</td>
<td>播放时间1</td>
<td>播放时间2</td>
<td>播放时间3</td>
</tr>";
$i = 0;
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['filename'] . "</td>";
echo "<td>" . $row['filesize'] . "</td>";//数据表中已经有文件名和文件大小,但是播放时间都默认为0,通过网页修改来update数据库
echo "<td><input name=\"<?php echo $i;$i++; ?>\" type=\"text\"></td>";
echo "<td><input name=\"<?php echo $i;$i++; ?>\" type=\"text\"></td>";
echo "<td><input name=\"<?php echo $i;$i++; ?>\" type=\"text\"></td>";
echo "</tr>";
}
echo "<input name=\"submit\" type=\"submit\" value=\"保存\" />";
echo "<br>";
echo "<input name=\"cancel\" type=\"button\" value=\"取消\" onClick=\"window.location.href=\'admincentre.php\'\"/>";
echo "</table></form>";
$i = 0;
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['filename'] . "</td>";
echo "<td>" . $row['filesize'] . "</td>";//数据表中已经有文件名和文件大小,但是播放时间都默认为0,通过网页修改来update数据库
echo "<td><input name=\"<?php echo 'time1_'.$i; ?>\" type=\"text\"></td>";
echo "<td><input name=\"<?php echo 'time2_'.$i; ?>\" type=\"text\"></td>";
echo "<td><input name=\"<?php echo 'time3_'.$i;; ?>\" type=\"text\"></td>";
echo "</tr>";
$i++;
}
------解决方案--------------------
你先 print_r($_POST); 看看
------解决方案--------------------
echo "<td><input name=\"<?php echo $i;$i++; ?>\" type=\"text\"></td>";
echo "<td><input name=\"<?php echo $i;$i++; ?>\" type=\"text\"></td>";