Give this a shot!
<?php
if (isset($_POST['yesBtn'])) {
echo "<p>".$_POST['yesBtn']."</p>";
}
if (isset($_POST['noBtn'])) {
echo "<p>".$_POST['noBtn']."</p>";
}
?>
<form action="somefile.php" method="POST">
<div class="form-group col-md-4">
<label>Available Options</label>
<div>
<button data-toggle="collapse" name="yesBtn" value="YES">YES </button>
<button data-toggle="collapse" name="noBtn" value="NO">NO</button>
</div>
</div>
</form>
Alternatively, you can try this:
<?php
if (isset($_POST['Btn'])) {
echo "<p>".$_POST['Btn']."</p>";
}
?>
<form action="somefile.php" method="POST">
<div class="form-group col-md-4">
<label>Sold Out</label>
<div>
<button data-toggle="collapse" name="btn" value="YES">YES </button>
<button data-toggle="collapse" name="btn" value="NO">NO</button>
</div>
</div>
</form>