send the selected variable of a select to get

1

I have this php file where the axis is chosen, it loads the Ids of the indicators that are related to it, but when I try to send them by Get to my other php file, it marks me an error of

  

Notice: Undefined index: IndicatorEje in   C: \ xampp \ htdocs \ SIEPRUEBAS \ indicators \ VistaIndicador.php on line 11

This is my first php file

<?php

if ((!isset($_COOKIE['user']) || $_COOKIE['user'] == "") || (!isset($_COOKIE['IdSession']) || strlen($_COOKIE['IdSession']) != 15)) {
    header("Location: ../../../index.php");
}

include_once("../WEB-INF/Classes/Catalogo.class.php");
include_once("../WEB-INF/Classes/Indicadores.2.class.php");
$catalogo = new Catalogo();
$Eje="";
$indicadorEje="";
?>       
        <fieldset> 
            <legend>Indicadores por Eje</legend>
            <form action="indicadores/VistaIndicador.php" method="get">
            <div class="row">
                <div class="form-group col-md-6">
                    <label for="inputState">Eje</label>
                    <select id="Eje" class="form-control" name="Eje" onchange="cargarIndicadorPorEje();" >
                        <?php
                        $consulta = "SELECT
                             c_proyecto.IdProyecto,
                           c_proyecto.Nombre
                                  FROM
                             c_proyecto
                               ORDER BY
                         c_proyecto.Nombre ASC
                                                   ";
                        $resultado = $catalogo->obtenerLista($consulta);
                   echo '<option value="">Seleccione una opción</option>';
                   while ($row = mysql_fetch_array($resultado)) {
                            $s = '';
                            if ($row['IdProyecto'] == $Eje) {
                                $s = 'selected="selected"';
                            }
                            echo '<option value="' . $row['IdProyecto'] . '" ' . $s . '>' . $row['Nombre'] . '</option>';
                        }
                        ?>   

                    </select>
                </div>
                <div class="form-group col-md-6">
                    <label for="inputState">Indicador</label>
                    <select id="IndicadorEje" class="form-control" name="IndicadorEje" onchange=""  >
                    </select>
                </div>
            </div>
                <div class="row" id="recargar" >                    
                </div>
         </form>
        </fieldset>
    </body>
</html>

This is the second php

<?php
include_once("../WEB-INF/Classes/Catalogo.class.php");
include_once("../WEB-INF/Classes/Indicadores.2.class.php");
 $obj = new Indicadores2();
$catalogo = new Catalogo();
$IndicadorEje = $_GET['IndicadorEje'];
echo $altura;
    
asked by carlos becerra 26.10.2018 в 16:23
source

1 answer

2

Your select IndicatorEje has no options, so it is not available in the GET variable, you would only have the variable Axis of the upper select available if you have options

    
answered by 26.10.2018 / 16:35
source