Here’s the HTML form:
<form action="test-html-form-process.php" method="post">
me <input type="checkbox" name="test[me]" value="me">
him <input type="checkbox" name="test[him]" value="him">
<hr>
<button type="submit">Send</button>
</form>
and then in the PHP side, I can loop through $_POST['test']
and access all the checked values, however, either of these gives an error:
var_dump($_POST['test']['me']); //I checked `me` box in the HTML form. //error: Notice: Undefined index: me in...
var_dump($_POST['test']['him']); //I checked `him` box in the HTML form. //error: Notice: Undefined index: him in...
Could you please explain this to me. Thanks a ton.