php if empty _POST and empty _POST and empty _POST if empty _POST empt

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<?php
//if(!empty($_POST['A']) and !empty($_POST['C']) and empty($_POST['B'))
if((!empty($_POST['A']) && !empty($_POST['C']) && empty($_POST['B'))
{
$B=sqrt($C*$C-$A*$A);
}
?>
<form name="bla" action="<?=$_SERVER['PHP_SELF']?>" method="POST">
A: <input type="text" name="A"> <br><br>
B: <input type="text" name="B"> <br><br>
C: <input type="text" name="C"> <br><br>
<input type="submit">
</form>