samedi 9 octobre 2021

Can't get checkbox array with phpBB 3.3's Request class

I have a POST form with the following checkboxes generated in a loop by PHP:

echo '<input class="form-check-input" type="checkbox" name="delist_ids[]" value="'.$row['id'].'" aria-label="Delist blacklisted server">';

Then on submit I'm trying to get the array containing the user's checked boxes (delist_ids). I'm using the Request class in the newest phpBB:

$delist_ids = $request->variable('delist_ids', array(), true, \phpbb\request\request_interface::POST);

But it just returns the default empty array. How can I get it to return the checked boxes' id?




Aucun commentaire:

Enregistrer un commentaire