Notice: Undefined index: cerdo in C:\Users\Umaru\Desktop\Data\php\cerdo_r.php on line 4
Notice: Undefined index: chapeta in C:\Users\Umaru\Desktop\Data\php\cerdo_r.php on line 5
el formulario es
<form class="form-horizontal" action="php/cerdo_r.php"; method="POST" id="cerdo">
<div class="form-group">
<label for="cerdo" class="col-sm-2 control-label">Cerdo</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="cerdo" required>
</div>
</div>
<!--Chapeta -->
<div class="form-group">
<label for="chapeta" class="col-sm-2 control-label">Chapeta</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="chapeta" required>
</div>
</div>
<!-- Raza -->
<div class="form-group">
<label for="raza" class="col-sm-2 control-label">Raza</label>
<div class="col-sm-10">
<select id="raza" name="raza" required>
<option>Seleccione</option>
<?php
$query = "SELECT * FROM raza ORDER BY raza";
$raza=$connect->query($query);
while($row = $raza->fetch_assoc()) { ?>
<option value="<?php echo $row['raza']; ?>"><?php echo $row['raza']; ?>
<?php } ?>
</select>
</div>
</div>
<!-- Genero -->
<div class="form-group">
<label for="genero" class="col-sm-2 control-label">Genero</label>
<div class="col-sm-10">
<select id="genero" name="genero" required>
<option>Seleccione</option>
<?php
$query = "SELECT * FROM genero ORDER BY genero";
$genero=$connect->query($query);
while($row = $genero->fetch_assoc()) { ?>
<option value="<?php echo $row['genero']; ?>"><?php echo $row['genero']; ?></option>
<?php } ?>
</select>
</div>
</div>
<!-- Modulo -->
<div class="form-group">
<label for="modulo" class="col-sm-2 control-label">Modulo</label>
<div class="col-sm-10">
<select id="modulo" name="modulo" required>
<option>Seleccione</option>
<?php
$query = "SELECT * FROM modulo ORDER BY modulo";
$modulo=$connect->query($query);
while($row = $modulo->fetch_assoc()) { ?>
<option value="<?php echo $row['modulo']; ?>"><?php echo $row['modulo']; ?></option>
<?php } ?>
</select>
</div>
</div>
<!-- Corral -->
<div class="form-group">
<label for="corral" class="col-sm-2 control-label">Corral</label>
<div class="col-sm-10">
<select id="corral" name="corral" required>
<option>Seleccione</option>
<?php
$query = "SELECT * FROM corral ORDER BY corral";
$corral=$connect->query($query);
while($row = $corral->fetch_assoc()) { ?>
<option value="<?php echo $row['corral']; ?>"><?php echo $row['corral']; ?></option>
<?php } ?>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
<Button form="cerdo" key="submit" htmlType="submit">
Submit
</Button>
Cerdo_r.php
<?php
require_once ("db.php");
$cerdo = $_POST['cerdo'];
$chapeta = $_POST['chapeta'];
$id_raza = $_POST['raza'];
$id_genero = $_POST['genero'];
$id_corral = $_POST['corral'];
$query = "INSERT INTO cerdo (cerdo, chapeta, id_raza, id_genero, id_corral)
VALUES ('$cerdo', '$chapeta', '$id_raza', '$id_genero', '$id_corral')";
$result=$connect->query($query);
$connect->close();
?>