How do you retrieve results of multiple checkboxes in php?

1 answer

Answer

1251502

2026-06-01 17:05

+ Follow

Well that's fairly easy, as - if you done it correctly - every checkbox has a name, and if this checkbox has been ticked, the POST or GET variable will hold a value named "on", after submitting the form. A standard code to check wether it has been submitted and checked can be something like:

if(isset($_POST['checkbox1']) && !empty($_POST['checkbox1'])){

do something here...

}

that's it.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.