我想對多個複選框應用驗證,但問題是如何執行?如何在多個複選框上應用驗證,同時我在for循環中有複選框
<?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
}
}
?>
你怎麼想驗證?你想什麼時候驗證它?你有什麼嘗試? – 2013-02-25 12:40:45
只需注意''mysql_fetch_object'已被棄用5.5.0 – PaulMrG 2013-02-25 12:44:11