so, this seems really simple, but I have been scratching my head for about an hour now.
Simple math, but I cannot replicate with code.
1 case = 4 bags, 4 bags = 8 bottles, 8 bottles = 1 case.
<form method="post">
<input type="text" name="cases" placeholder="cases...">
<input type="text" name="bottles" placeholder="bottles...">
<button name="submit">submit</button>
<?php echo $output; ?>
</form>
if(isset($_POST['submit'])){
$cases = $_POST['cases'];
$bottles = $_POST['bottles'];
$xcases = $cases * 4;
$xbottles = $bottles / 4;
$c = $xbottles + $xcases;
$output = $xbottles;
}
I’ve tried changing the math around, but just can’t seem to get it right.