
Originally Posted by
zamzam
Hello crmalibu,
what do you mean by saying web browsers will not send a checkbox that is not "checked".
Here, check (pun intended) it out.
PHP Code:
<?php
if(true === array_key_exists('submit', $_POST))
{
echo '<pre>', print_r($_POST, true);
exit;
}
?>
<h4>Your favourite Beatles members.</h4>
<form method="post" action="">
<p>
Ringo Starr
<input type="checkbox" name="favBeatles[]" value="Ringo" />
</p>
<p>
John Lennon
<input type="checkbox" name="favBeatles[]" value="John" />
</p>
<p>
Paul McCartney
<input type="checkbox" name="favBeatles[]" value="Paul" />
</p>
<p>
George Harrison
<input type="checkbox" name="favBeatles[]" value="George" />
</p>
<input type="submit" name="submit" value="vote" />
</form>
Bookmarks