My problem is as follows I have a BOOSTRAP
menu where the content is extracted from a database mysql
, being that when selecting an option I load the content of a page in a field div
of central id. When I make the selection I am already in session and I have some variables extracted from the BD
that I send them by the method GET
and the variable arrives perfectly, the problem is presented in the selection of new variables that are in the menu because do not reach the div
central.
To explain me better, I place parts of script
in code AJAX
:
$('#div-btn5').click(function(){
$.ajax({
type: "GET",
url: "clases.php?ci=<?php echo $assoc_prosesar['ci']; ?>&idTema=<?php echo $modulo['idTema']; ?>",
success: function(a) {
$('#central').html(a);
}
});
});
Menu code is as follows:
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li><a href="#" class="dropdown-toggle" data-toggle="dropdown">Ver Clases<span class="caret"></span></a>
<ul class="dropdown-menu">
<li class="dropdown-submenu">
<?php
$busqUsuario="SELECT * FROM $tabla4 WHERE idalumno='$ci'"; //matricula
$resultUsuario = mysqli_query($db, $busqUsuario) or die(mysql_error());
?>
<?php
if ($cursoUsuario=mysqli_fetch_array($resultUsuario)){
do {
$idCurso=$cursoUsuario['idCurso'];
$busqCurso="SELECT * FROM $tabla3 WHERE id='$idCurso'"; //curso
$resultCurso = mysqli_query($db, $busqCurso) or die(mysql_error());
$curso=mysqli_fetch_array($resultCurso);
?>
<a href="#" class="test" ><?php echo $curso['curso']; ?><span class="caret"></span></a>
<ul class="dropdown-menu">
<?php
$busqModulo="SELECT * FROM $tabla5 WHERE curso='$idCurso'"; //modulo
$resultModulo = mysqli_query($db, $busqModulo) or die(mysql_error());
if ($modulo=mysqli_fetch_array($resultModulo)){
do {
$idTemaSession=$modulo['idTema'];
if($modulo['cargado']=='SI'){
$busqCurso="SELECT * FROM $tabla11 WHERE id='$idCurso'"; //curso
$resultCurso = mysqli_query($db, $busqCurso) or die(mysql_error());
$curso=mysqli_fetch_array($resultCurso);
?>
<li><a href="#" id="div-btn5" ><?php $e= addslashes($modulo['tema']); $codificadoe = utf8_encode($e); echo $codificadoe;?></a></li>
<?php }
} while ($modulo=mysqli_fetch_array($resultModulo));
}
?>
</ul>
<?php
} while ($cursoUsuario=mysqli_fetch_array($resultUsuario));
}
?>
</li>
</ul>
</li>
In a publication of a problem on this page I saw an example where they modified href="#"
by href="?ci=<?php echo $assoc_prosesar['ci']; ?>&idTema=<?php echo $modulo['idTema']; ?>"
but it did not work for me. I hope you can help me and in advance I thank you for the time devoted to this problem.