So I have an array of stings in php, I assign that array to an array of checkboxes. I need away to remember which checkbox was checked whenever I click submit(the page returns to itself for validation, outputting errors if there are any)
here is my code:
$courseOffering = array(
'CST8110 Introduction to Computer Programming 5 hrs/w',
'CST8209 Web Programming I 5 hrs/w',
'CST8260 Database System and Concepts 4 hrs/w',
'ENL1813T Communications I 3 hrs/w',
'MAT8001 Math Fundamentals 3 hrs/w',
'MGT8100 Career and College Success Skills 3 hrs/w',
'CST8250 Database Design and Administration 5 hrs/w',
'CST8253 Web Programming II 4 hrs/w',
'CST8254 Network Operating Systems 5 hrs/w',
'CST8255 Web Imaging and Animations 4 hrs/w',
'CST8256 Web Programming Languages I 5 hrs/w',
'CST8257 Web Applications Development 5 hrs/w',
'CST8258 Web Project Management 3 hrs/w',
'ENL1819T Reporting Technical Information 4 hrs/w',
'WKT8100 Cooperative Education Work Term Preparation 15 hrs/w',
'CST8259 Web Programming Languages II 5 hrs/w',
'CST8265 Web Security Basics 5 hrs/w',
'CST8267 Ecommerce 4 hrs/w' );
?>
$count = count($courseOf fering);
for($i=0; $i < $count; $i++){
echo("<input type=\"checkbox \" id = \"checkBox\" name= \"courseCheckbo x[]\" value = $courseOffering[$i] >$courseOfferin g[$i]</input>");
echo("</br>");
}
here is my code:
$courseOffering = array(
'CST8110 Introduction to Computer Programming 5 hrs/w',
'CST8209 Web Programming I 5 hrs/w',
'CST8260 Database System and Concepts 4 hrs/w',
'ENL1813T Communications I 3 hrs/w',
'MAT8001 Math Fundamentals 3 hrs/w',
'MGT8100 Career and College Success Skills 3 hrs/w',
'CST8250 Database Design and Administration 5 hrs/w',
'CST8253 Web Programming II 4 hrs/w',
'CST8254 Network Operating Systems 5 hrs/w',
'CST8255 Web Imaging and Animations 4 hrs/w',
'CST8256 Web Programming Languages I 5 hrs/w',
'CST8257 Web Applications Development 5 hrs/w',
'CST8258 Web Project Management 3 hrs/w',
'ENL1819T Reporting Technical Information 4 hrs/w',
'WKT8100 Cooperative Education Work Term Preparation 15 hrs/w',
'CST8259 Web Programming Languages II 5 hrs/w',
'CST8265 Web Security Basics 5 hrs/w',
'CST8267 Ecommerce 4 hrs/w' );
?>
$count = count($courseOf fering);
for($i=0; $i < $count; $i++){
echo("<input type=\"checkbox \" id = \"checkBox\" name= \"courseCheckbo x[]\" value = $courseOffering[$i] >$courseOfferin g[$i]</input>");
echo("</br>");
}
Comment