I need to save the ID of the event I want to register the presence of a certain student in the Bank, but I also need to save some other data, so I created a <?php if(!isset($_POST['evento'])):?>
But I need to send the value of both my form that only "looks for" where it contains the event / idevento, and of the values that I inserted for the presence of the student. Here is how the form code is currently. What would I need to spend to send all these values all at once?
<?php if(!isset($_POST['evento'])):?>
<form method="POST" >
<input type="hidden" name="evento" value="QQCOISA" hidden/>
<h3>Nome do Evento</h3>
<select name="idevento">
<?php
include "conectar.php";
$sql = "SELECT * FROM evento";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<option value='".$row["idevento"]."'>".$row["noeve"]."</option>";
$idkappa = $row["idevento"];
}
} else {
echo "Sem eventos ativos";
}
$conn->close();
?>
</select>
<input type="submit" value="Selecionar Evento"/>
<?php else: ?>
<form method="POST" action="input.php">
<input type="hidden" name="pagina" value="inserirReg" hidden/>
<input type="hidden" name="idevento" hidden/>
<h3>Dia Evento</h3>
<select name="seqDia">
<?php
include "conectar.php";
$sql = "SELECT * FROM diaevento WHERE idevento=".$_POST["idevento"];
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<option value='".$row["idevento"]."'>".$row["seqDia"]."</option>";
}
} else {
echo "Sem eventos ativos";
}
$conn->close();
?>
</select>
EDIT: I did not see any need to put the end of code <?php endif; ?>
, because there are only a few selects like Event Day.