1To pass the multiple checkbox values in one POST action in PHP you can refer below code:
2
3Html form code
4<form method="post" action="send_data.php">
5 <input type="checkbox" name="username[]" value="user1">User1
6 <input type="checkbox" name="username[]" value="user2">User2
7 <input type="checkbox" name="username[]" value="user3">User3
8 <input type="checkbox" name="username[]" value="user4">User4
9 <input type="submit" name="submit_data"/>
10</form>
11send_data.php
12<?php
13if(isset($_POST["submit_data"])){
14 if(!empty($_POST["username"])){
15 // to check the username checkboxes values you can use loop to display each checkbox value
16 $usernames = $_POST["username"];
17 foreach($usernames as $user){
18 echo "User Name :".$user;
19 }
20 }
21}
22?>