<?php
$a = $_POST['a'];
$b = $_POST['b'];
$c = $_POST['c'];
if (!empty($_POST['a']) && !empty($_POST['b']) && empty($_POST['c']))
{
$c = sqrt(pow($a,2)+pow($b,2));
$text = "C: ". $c;
}
elseif (empty($_POST['a']) && !empty($_POST['b']) && !empty($_POST['c']))
{
$a = sqrt(pow($c,2)-pow($b,2));
$text = "A: ". $a;
}
elseif (!empty($_POST['a']) && empty($_POST['b']) && !empty($_POST['c']))
{
$b = sqrt(pow($c,2)-pow($a,2));
$text = "B: ". $b;
}
elseif (!empty($_POST['a']) && !empty($_POST['b']) && !empty($_POST['c']))
{
$error = 1;
$text = "Да ты ошалел парень, все поля вводить!";
}
?>
<form name="bla" action="" method="post">
<input type="text" name="a" value="<?php echo $a; ?>">
<input type="text" name="b" value="<?php echo $b; ?>">
<input type="text" name="c" value="<?php echo $c; ?>">
<input type="submit" name="submit">
</form>
<?php
if ($_POST['submit'])
{
?>
<textarea name="" id="" cols="30" rows="10"><?php echo $text; ?></textarea>
<br>
<a href="/">Назад</a>
<?php
}
?>