I can not resolve this error. Notice: Undefined variable: arvore_repor in C: e Notice: Undefined variable: pay_value in C:

0
<?php
include("header.php");
include_once "Classe.php";
?>

<?php
$Ano = $_POST["Ano"];
$Estado = $_POST["Estado"];
$N_arvores_cortadas = $_POST["N_arvores_cortadas"];
$Volume = $_POST["Volume"];




$con = new mysqli("localhost","root",null,"calculo");

$con->query("INSERT INTO cal
 (Ano,Estado,N_arvores_cortadas,Volume,arvore_repor,valor_pagar) 
 VALUES ('$Ano','$Estado','$N_arvores_cortadas','$Volume','$arvore_repor','$valor_pagar')");

?>

<div class="alert alert-primary" role="alert">
  Gravado com Sucesso!
</div>


<a href="CalculadoraReflorestamento.php">Cadastrar</a>
<a align="left"><h3><font color='blue'>Valor R$ = 300</font></h3></a>
<table class="table">
  <thead class="thead-dark">
    <tr>
      <th scope="col">Ano</th>
      <th scope="col">Estado</th>
      <th scope="col">Nº arvores cortadas</th>
      <th scope="col">Volume(m³)</th>
      <th scope="col">Árvores a
Repor </th>

      <th scope="col">Valor a ser
pago </th>
    </tr>
  </thead>
  <tbody>
  <?php
  $con = new mysqli("localhost","root",null,"calculo");
  $r = $con->query("SELECT Ano,Estado,N_arvores_cortadas,Volume,arvore_repor,valor_pagar FROM cal");
  while ($l = $r->fetch_assoc()) {
echo "
<tr>
<th scope='row'><font color='white'><h3>$l[Ano]</h3></font></th>
<td ><font color='white'><h3>$l[Estado]</h3></font></td>
<td><font color='white'><h3>$l[N_arvores_cortadas]</h3></font></td>
<td><font color='white'><h3>$l[Volume]</h3></font></td>
<td><font color='white'><h3>$l[arvore_repor]</h3></font></td>
<td><font color='white'><h3>$l[valor_pagar]</h3></font></td>
</tr>

";
echo "$Estado";
  }
    ?>

    
asked by anonymous 14.12.2018 / 00:14

1 answer

0

This error occurs because you have been missing your $

$arvore_repor = isset($_POST["arvore_repor"]) ? ($_POST["arvore_repor"]) : '';

or you can simply use the function:

error_reporting(0);
    
14.12.2018 / 01:04