<input name="array[]" type=.....

解决方案 »

  1.   

    <table>
    <?php
    for ($i=1;$i<count($yourarray)+1;$i++)
    {
    ?>
    <tr>
    <?php
    echo $yourarray[$i];
    ?>
    </tr>
    <?php
    }
    ?>
    </table>
      

  2.   

    一小部份片段,这里是命名相关部份:$i=1;
    echo "<tr>";
    while($row=mysql_fetch_array($res))
    {
    echo "<td><input type='checkbox' name='checkbox2[$i]' value='$row[code]'>";
    echo "&nbsp;$row[name]</td>";
    if(($i%$page)==0)
    {
    echo "</tr>";
    }
    $i++;
    }
    echo "<input type='hidden' name='hidden_type' value='$i'>";
    接收取值的:
    for($i=1;$i<=$_POST[hidden_type];$i++)
    {
    echo $checkbox2[$i];
    }
      

  3.   

    <input name="array[下标]" value="值" type=.....
      

  4.   

    <input name="Material[0]" type="text" id="Material[0]" >
    document.formMain.Material[0].value
    为什么会出错?
      

  5.   

    var xxx=document.getElementById("Material[0]");
    xxx.value=.....
      

  6.   

    document.getElementById("Material[index]");
    里面有变量为什么就不行了?
    还有网页里的下标用什么Tag
      

  7.   

    取同样的名字,不用下标,比如:Material[]
      

  8.   

    feyge(菲戈@我是永远向着远方独行的浪子)说得很对
    $i=1;
    echo "<tr>";
    while($row=mysql_fetch_array($res))
    {
    echo "<td><input type='checkbox' name='checkbox2[$i]' value='$row[code]'>";
    echo "&nbsp;$row[name]</td>";
    if(($i%$page)==0)
    {
    echo "</tr>";
    }
    $i++;
    }
    echo "<input type='hidden' name='hidden_type' value='$i'>";
    接收取值的:
    for($i=1;$i<=$_POST[hidden_type];$i++)
    {
    echo $checkbox2[$i];
    }
    就是这样