Indefinite index - Error in obtaining the contents of a field

0

Good I do not understand because it tells me that I have not defined the value idValidar.

Error

  

Notice: Undefined index: idValidate in   C: \ xampp \ htdocs \ PHP_WEB_MMR \ Platform \ PHP \ Project \ validateProposal.php   online 21

Until now, when I wanted to get the content of a field, I always did it using the name of the form.

HTML code

<form action="PHP/Proyecto/validarPropuesta.php" method="post">
  <h2 class="texto">Validar propuestas</h2>
  <input type="text"     name="idValidar" placeholder="Introducir id">
  <input type="submit"   value="Validar">
</form>

Php code

<?php

  $bd_host = "localhost"; 
  $bd_usuario = "root"; 
  $bd_password = ""; 
  $bd_base = "carrot";

  $conexion = mysqli_connect($bd_host, $bd_usuario, $bd_password);
  mysqli_select_db($conexion,$bd_base);

  $idValidacion = $_POST['idValidar'];
  //    $idValidacion = mysqli_real_escape_string($conexion, $_POST['idValidar']);

  $revision = 2;

  $consulta = "
    UPDATE propuesta
    SET revision='$revision'
    WHERE id = $idValidacion
  ";

  $resultado = mysqli_query($conexion, $consulta);

  // Liberamos y cerramos conexión.
  mysqli_free_result($resultado);
  mysqli_close($conexion);

?>
    
asked by NEA 15.08.2018 в 16:47
source

0 answers