在一个页面中我想用一组文本框,请问怎样用把数组添进去,关键是不知道怎样取名字 <input name="array[]" type=..... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <table><?phpfor ($i=1;$i<count($yourarray)+1;$i++){?><tr><?phpecho $yourarray[$i];?></tr><?php}?></table> 一小部份片段,这里是命名相关部份:$i=1;echo "<tr>";while($row=mysql_fetch_array($res)){ echo "<td><input type='checkbox' name='checkbox2[$i]' value='$row[code]'>"; echo " $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]; } <input name="array[下标]" value="值" type=..... <input name="Material[0]" type="text" id="Material[0]" >document.formMain.Material[0].value为什么会出错? var xxx=document.getElementById("Material[0]");xxx.value=..... document.getElementById("Material[index]");里面有变量为什么就不行了?还有网页里的下标用什么Tag 取同样的名字,不用下标,比如:Material[] feyge(菲戈@我是永远向着远方独行的浪子)说得很对$i=1;echo "<tr>";while($row=mysql_fetch_array($res)){ echo "<td><input type='checkbox' name='checkbox2[$i]' value='$row[code]'>"; echo " $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]; }就是这样 php页面的作用域问题 php 生成 phpDoc 问题 寻找从文件指针中获取文件完整内容的方法 php 执行错误sql不报错 php基础区越来越火啊 僧多肉少啊 送分顶起 高手&热心的朋友请进来 帮我看下! 上传图片时无法获得图片信息的问题,急!!! 刚学习类,自己尝试写点东西,请大家给点意见!:) windows下PHP配置的问题。 php中怎样迁入ocx文件 php配置高手 如何升级php版本
<?php
for ($i=1;$i<count($yourarray)+1;$i++)
{
?>
<tr>
<?php
echo $yourarray[$i];
?>
</tr>
<?php
}
?>
</table>
echo "<tr>";
while($row=mysql_fetch_array($res))
{
echo "<td><input type='checkbox' name='checkbox2[$i]' value='$row[code]'>";
echo " $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];
}
document.formMain.Material[0].value
为什么会出错?
xxx.value=.....
里面有变量为什么就不行了?
还有网页里的下标用什么Tag
$i=1;
echo "<tr>";
while($row=mysql_fetch_array($res))
{
echo "<td><input type='checkbox' name='checkbox2[$i]' value='$row[code]'>";
echo " $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];
}
就是这样