| 
 Posted by macca on 09/08/07 00:38 
The HTML form: 
 
<p>Please select every sport that you play.</p> 
 
Soccer: <input type="checkbox" name="sports[]" value="soccer"  /><br / 
> 
Football: <input type="checkbox" name="sports[]" value="football"  / 
><br /> 
Baseball: <input type="checkbox" name="sports[]" value="baseball"  / 
><br /> 
Basketball: <input type="checkbox" name="sports[]" 
value="basketball"  /> 
 
 
 
 
 
--------------------------------------------------------------------------------------- 
 
The php script: 
 
 
$sports = $_POST['sports'];   // is an array holding all the checked 
boxes 
 
foreach ($sports as $checked_sport){ 
 
echo $checked_sport."<br />"; // Output the checked boxes to the 
output device. 
 
}
 
  
Navigation:
[Reply to this message] 
 |