hi have form takes several answers in checkboxes
<p>select modules take:<br /> module1 <input type="checkbox" name="modules" value="module1"/><br /> module2 <input type="checkbox" name="modules" value="module2" /><br /> module3 <input type="checkbox" name="modules" value="module3" /><br /></p>
now in response page have foreach loop, doesn't execute anything
foreach ($modules $selected){ print "<p>modules ".$selected."</p>"; };
any this? in advance
if name checkboxes this, array (with brackets [])
<input type="checkbox" name="modules[]" value="module1"/>
and of course need iterate correct array:
foreach($_post['modules'] $selected) {
Comments
Post a Comment