rendered paste body<form method="post" action="calcul.php">
<p>Rayon<input type="text" name="rayon"/></p>
<p>Hauteur<input type="text" name="hauteur"/></p>
<input type="submit" value="Calculer"/>
</form>
<?php
if (isset($_POST['rayon']) && isset($_POST['hauteur'])) { $volume = volume($_POST['rayon'], $_POST['hauteur']); }
function volume($rayon, $hauteur)
{
$volume=$rayon*$rayon*3.14*$hauteur*(1/3);
return $volume;
}
$volume = volume($_POST['rayon'], $_POST['hauteur']);
echo "Le volume du cone est de $volume";
?>