How can I get the value '0' and '1' out of my toggle button? The value one or zero will be sent to the order.inc.php page when the button is pressed.
Order.php page:
<div class="checkbox">
<form method="post" action="includes/edit-orderstatus.inc.php">
<td><input type="checkbox" checked data-toggle="toggle" data-off="Shipped" data-on="Pending" data-offstyle="success" id="statusOrder" name="statusOrder" data-onstyle="danger" value="1"></td>
<input type="hidden" name="orderID" id="orderID" value="<?php echo ($datas[$i]['ID']);?>">
<td><button class="btn btn-dark" type="submit" name="orderstatus-submit">Submit</button></td>
</form>
</div>
Order.inc.php page
<?php
if(isset($_POST['orderstatus-submit'])){
require('../php/connection.php');
$toogleButtonValue = (int)(isset($_POST['statusOrder']) && $_POST['statusOrder'] == 1);
echo $toogleButtonValue;
}