I am making a page for a school project and I try to show some communications. This is the code where I request that releases I want to show depending on who is logged in.
<?php
if (isset($_SESSION['username']) && $_SESSION['rol']=='administrador'){
echo '<button type="button" class="btn btn-primary btn-sm" onclick="cargar(\'#capa_d\',\'alta_co.php\')">Nuevo Comunicado</button>';
echo '<button type="button" class="btn btn-primary btn-sm" onclick="cargar(\'#capa_L\',\'mostrar_comunicados.php?b=administrador\'),cargar(\'#capa_d\',\'mostrar_comunicados.php?c=administrador\')">Ver Comunicados</button>';
}
if (isset($_SESSION['username']) && $_SESSION['rol']=='Docente'){
echo '<button type="button" class="btn btn-primary btn-sm" onclick="cargar(\'#capa_d\',\'alta_co.php\')">Nuevo Comunicado</button>';
echo '<button type="button" class="btn btn-primary btn-sm" onclick="cargar(\'#capa_L\',\'mostrar_comunicados.php?b=Docente\'),cargar(\'#capa_d\',\'mostrar_comunicados.php?c=Docente\')">Ver Comunicados</button>';
}
if (isset($_SESSION['username']) && $_SESSION['rol']=='Padre'){
echo '<button type="button" class="btn btn-primary btn-sm" onclick="cargar(\'#capa_d\',\'alta_co.php\')">Nuevo Comunicado</button>';
echo '<button type="button" class="btn btn-primary btn-sm" onclick="cargar(\'#capa_L\',\'mostrar_comunicados.php?b=Padre\'),cargar(\'#capa_d\',\'mostrar_comunicados.php?c=Padre\')">Ver Comunicados</button>';
}
?>
And the error Notice: Undefined index: b in show_comunicados.php on line 5 I get in these lines of code of show_comunicados.php that is where I send them above
$str_b = $_GET['b'];
$str_c = $_GET['c'];
I appreciate any help