I'm trying to get the selected value from my comboBox in PHP inside a while loop fetching MySQL results. How could I do it?
<?php
include ("../conex.php");
$conSql = ("CALL LISTAR_ASIGNATURAS()");
$datos=mysqli_query($conex,$conSql);
echo "<a style='font-size:16px;' href='../index.html'>Volver Atras</a>";
echo " ";
echo "<select name='asigna' id='y' style='width:280px; height:23px;'>";
echo "<option value='0'>Seleccione una Asignatura...</option>";
while($fila=mysqli_fetch_assoc($datos)) {
echo "<option value='".$fila["cod_asignatura"]."'>".$fila["nom_asignatura"]. "</option>";
}
echo "</select>";
echo " ";
echo "<input type='submit' onclick=location.href='listarasig2.php?codA=".$selected_val."' value='Buscar'>";
?>