I'm working on Data-tables with PHP.
I have a table in first column there is a check box which says Select All and every row has a checkbox.

When a user clicks on the select all check box only those checkbox values of row visible will be fetched and shown in php after is click on submit.
The issue is when i select a checkbox from page no 2 say i have checked on Australia with id 13
and i go to page no 3 and select nothing. Then click on submit i do not get the $_POST field name with the is of Australia.
But when is but when check on Australia and click submit without changing the page then it will fetch me its $_POST details.

I want to know is their a way the get checkbox data to php when i have selected multiple checkbox from different pages.
I'm using latest datatable js files.
Images are used to let developer understand.
Below is my HTML CODE
view.php
<
?php
require 'conn.php';
$sql = "SELECT * FROM tbl_country";
$result = $conn->query($sql);
$country_array = array();
if ($result->num_rows > 0) {
// output data of each row
while ($row = $result->fetch_assoc()) {
$country_array[] = $row;
}
} else {
echo "0 results";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
</head>
<body>
<br>
<br>
<div class="container">
<form action="process.php" method="post">
<input type="submit" name="submit" value="submit">
<table class="table table-bordered" id="example" >
<thead>
<tr>
<th>
<label for="select_all">
<input type="checkbox" id="select_all" onclick="selectAll()" name="select_all" value="1" > Select All
</label>
</th>
<th>id</th>
<th>name</th>
</tr>
</thead>
<tbody>
<?php
foreach ($country_array as $value) {
?>
<tr>
<td>
<label for="select_one_<?php echo $value['country_id']; ?>">
<input type="checkbox" class="common_class" id="select_one_<?php echo $value['country_id']; ?>" name="select_one_<?php echo $value['country_id']; ?>" value="select_one_<?php echo $value['country_id']; ?>">
</label>
</td>
<td><?php echo $value['country_id']; ?></td>
<td><?php echo $value['country_name']; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</form>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js">
</script>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js">
</script>
<script>
$(document).ready(function () {
$('#example').DataTable({
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
});
});
function selectAll() {
var is_checked = document.getElementById('select_all').checked;
if (is_checked) {
$('.common_class').prop('checked', true);
} else {
$('.common_class').prop('checked', false);
}
console.log(is_checked);
}
</script>
</body>
</html>
PHP FILE process.php code
<?php
echo '<pre>';
print_r($_POST);
?>
php file conn.php
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "tempco_cms";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
