CheckBox命名为 aaa[] 但是我如何判断哪个被选择啊??? 按顺序,依次是aaa[0]为第一个,aaa[1]为第二个。依此类推 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没有什么好办法你只有给每个checkbox赋不同的value值 每个checkbox赋不同的value值,不就知道了么? <?function show_order_list($sort,$page){$query="select * from sms_content where sort='$sort' order by code";$res=mysql_query($query);$i=1;echo "<tr>";while($row=mysql_fetch_array($res)){ echo "<td><input type='checkbox' name='checkbox2[$i]' value='$row[code]'>"; echo " <a href='javascript:void(0)' onclick=MM_openBrWindow('smsopen.php?code=$row[code]','openwindow','width=480,height=450')>$row[name]</a></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]; } 请问可以这样吗?if(empty($_POST['aaa[0]'])){...........}if(empty($_POST['aaa[1]'])){...........}if(empty($_POST['aaa[2]'])){...........} 不行 啊<html><head> <title></title></head><body><?phpif(!empty($_POST['aaa[0]'])){echo "testtesttest".$_POST['aaa[0]'];}else{?><form action="#" method=post><input type=checkbox value="1" name="aaa[]"><input type=checkbox value="1" name="aaa[]"><input type=checkbox value="1" name="aaa[]"><input type=checkbox value="1 "name="aaa[]"><input type=submit value=submit></fomr></body></html><?}?> PHP5+APACHE2.2.17关于POST提交的郁闷问题~ php分行显示数据 请能手帮忙 PHP多维数组处理!删除重复元素! 一个session问题 我用php编写的留言簿,现在总是被自动加入了很多广告留言,请问应该怎样阻止? xajax晕晕晕,新手搞不定啊 谁有webmail的代码 急!~哪位能帮我看看PHP移植问题 新手学习PHP遇到一个问题!求解决 请问一个关于写数据进库的问题,请指教,谢谢! phplib模板中调用require后怎样把require中输出的内容定位?
function show_order_list($sort,$page)
{
$query="select * from sms_content where sort='$sort' order by code";
$res=mysql_query($query);
$i=1;
echo "<tr>";
while($row=mysql_fetch_array($res))
{
echo "<td><input type='checkbox' name='checkbox2[$i]' value='$row[code]'>";
echo " <a href='javascript:void(0)' onclick=MM_openBrWindow('smsopen.php?code=$row[code]','openwindow','width=480,height=450')>$row[name]</a></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];
}
if(empty($_POST['aaa[0]']))
{
...........
}if(empty($_POST['aaa[1]']))
{
...........
}if(empty($_POST['aaa[2]']))
{
...........
}
<title></title>
</head><body><?php
if(!empty($_POST['aaa[0]']))
{
echo "testtesttest".$_POST['aaa[0]'];
}
else
{
?>
<form action="#" method=post>
<input type=checkbox value="1" name="aaa[]">
<input type=checkbox value="1" name="aaa[]">
<input type=checkbox value="1" name="aaa[]">
<input type=checkbox value="1 "name="aaa[]">
<input type=submit value=submit>
</fomr></body></html>
<?
}?>