我想对多个复选框应用验证,但问题是如何做到这一点?
<?php
mysql_connect("localhost","root","thisis");
mysql_select_db("my_database");
if(isset($_GET["q"]))
{
$my_q = $_GET['q'];
$q="select * from subjects where subj_code='$my_q'";
$rs=mysql_query($q);
for($i=0;$i<mysql_num_rows($rs);$i++)
{
$rd=mysql_fetch_object($rs);
?>
<input type="checkbox" name="subj[]" value="<?php echo $rd->subj_name; ?>" /><?php echo $rd->subj_name; ?>
<br />
<?php
}
}
?>