Hi, I searched the forums but I could not find the solution. I'm trying to enter records.
<div align="center">
<form action="cliente_ingresado.php" method="post">
<div>
<label for="identificacion" >Identificación: </label>
<input type="text" name="identificacion" id="identificacion" required="required"/>
</div>
<div>
<label for="nombre" >Nombre: </label>
<input type="text" name="nombre" id="nombre" required="required"/>
</div>
<div>
<label for="direccion">Dirección: </label>
<input type="text" name="direccion" id="direccion" />
</div>
<div>
<label for="telefono">Teléfono: </label>
<input type="text" id="telefono" name="telefono"/>
</div>
<div>
<label for="correo">Correo: </label>
<input type="email" id="correo" name="correo"/>
</div>
<div>
<label for="sexo">Sexo: </label>
<input type="text" id="sexo" name="sexo"/>
</div>
<div>
<label for="estado_civil">Estado Civil: </label>
<input type="text" id="estado_civil" name="estado_civil"/>
</div>
<div class="button">
<button type="submit" name="submit">Guardar</button>
<button type="button">Limpiar</button>
</div>
</form>
Here process:
echo $_POST['identificación'];
if(isset($_POST['submit']) && !empty($_POST['submit'])) {
$identificacion = $_POST['identificación'];
$nombre = $_POST['nombre'];
$direccion = $_POST['direccion'];
$telefono = $_POST['telefono'];
$correo = $_POST['correo'];
$sexo = $_POST['sexo'];
$estadoCivil = $_POST['estadoCivil'];
$insertar = "INSERT INTO tbl_clientes (identificacion, nombre, direccion, telefono, correo, sexo, estado_civil) VALUES ('$identificacion', '$nombre', '$direccion', '$telefono', '$correo', '$sexo', '$estado_civil')";
$ejecutar = mysqli_query($con, $insertar);
echo $ejecutar;
if($ejecutar)
{
echo "Insertado correctamente";
}
else
{
echo "Error";
}
mysqli_close($con);
}
else
{
echo "Insert no definido";
}
But he tells me he is undefined