You would create the HTML for the form like you would always, under the name field you would add [ ]'s after the name so when and if the user chooses more than one, it will create a multidimensional POST array.
<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" />
So if I came to your site and chose the checkboxes soccer, baseball, and basketball, you would reference the chosen values like so:
[php]$_POST[‘sports’][0] // soccer
$_POST[‘sports’][1] // baseball
$_POST[‘sports’][2] // basketball[/php]
And you could use the foreach statement to decompose the values:
[php]foreach($_POST[‘sports’] as $value)
{
echo $value.’
’;
}[/php]
If someone just chose one, you would just reference the first one as follows
[php]$_POST[‘sports’][0][/php]
I hope this helps you.