0
votes
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Calcular area del rectangulo</title>
</head>
<body>
    <div class="contenedor" > 
          <form  action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>"
            methode="post">
            Base: <input type="number"class="formulario" name="base" 
            placeholder="Base" value="<?php if(isset($_POST['base'])){ echo $_POST['base'];} ?>"> <br>
            Altura:<input type="number"class="formulario" name="altu" 
            placeholder="Altura" value="<?php if(isset($_POST['altu'])){ echo $_POST['altu'];} ?>"> <br>
           <input type="submit" name="Calcular" class="btn btn-cal" value="Calcular"> <br>

          <?php

           $post =(isset($_POST['base'])&&!empty($_POST['base']))&&(isset($_POST['altu'])&&!empty($_POST['altu']));
           if($post){
          $base=htmlspecialchars($_POST['base']);
          $altu=htmlspecialchars($_POST['altu']);
          $Area=($_POST['base'] * $_POST['altu']);
           }
          ?>
          

          <input type="number" class="form-control" name="area" placeholder="area" value="<?=$Area?>">
        </form>

      </div>
      <a href="index.php">Menu principal</a><br>
    enter code here

</body>
</html>

I have to calculate the area of a figure, I have everything done, but the problem is that when I calculate it, the result does not appear in the area.