在一个页面中我想用一组文本框,请问怎样用把数组添进去,关键是不知道怎样取名字 <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]; }就是这样 关于mvc开发,提交表单的时候action="?" 为什么我在url地址后加一个id=2023或者是id=<script>alert"xx"</script>,网站也能正常打开首页 请教 开发一个这样的系统需要多长时间,价格大概多少?有经验的说说 php如何访问映射文件 关于setcookie()与header()的问题 php怎么读取目录结构? 为什么只能显示255个字符?(后续) 服务器上的目录文件删不掉是怎么回事? php 线程安全编译 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];
}
就是这样