I would like to display whether an element(s) in a checkbox array was previously selected. I have my html code in an include so I would like to use $_POST if possible. I can do text using isset($_POST) but can’t do it with the checkbox array. I don’t want to have to assign an array to the $_POST[hrbox] because of the include. (I want to be able to include this onto several pages.) Here’s my code:<?php if (isset($_POST['hbox'])) echo 'checked'; ?>
(note: can you use a subscript in a POST? It doesn’t seem to work.)
When the isset didn’t work, I tried array_key_exists but got an error that hbox was not defined.