I need the result of the form to appear on the same screen, I made the following code:
<?php
//Recolhe os valores digitados no formulário
$v = $_POST['valor'];
$tm = $_POST['txmensal'];
$p = $_POST['periodo'];
$ta = (((($tm/100)+1)**12)-1)*100;
?>
Here ... the form
<form class="form form-control" method="POST">
<h5 class="mt-2">Converter juros mensais para anuais</h5>
<label for="valor" name="valor">Valor </label>
<input type="text" name="valor" class="form-control">
<label for="txmensal" name="txmensal" class="mt-1">Taxa Mensal </label>
<input type="text" name="txmensal" class="form-control" placeholder="%">
<label for="periodo" name="periodo" class="mt-1">Período </label>
<input type="text" name="periodo" class="form-control" placeholder="meses">
<input class="btn btn-default mt-1" type="submit" value="Submit">
<?php
if ($_POST['submit']){?>
<div class="alert alert-success mt-4 text-center">
<?php echo 'A taxa anual é: ' .$ta?>
</div>
<?php }?>
</form>