error when passing variable php with ajax

Question:

My problem is the following I have a BOOSTRAP menu where I BOOSTRAP the content from a mysql database, being that when selecting an option I load the content of a page in a central id div field. When I make the selection I am already in session and I have some variables extracted from the BD that I send them through the GET method and the variable arrives perfectly, the problem is in the selection of new variables that are in the menu because they do not reach the div central. To explain myself better I put parts of the script in the AJAX code:

$('#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 post 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 didn't work for me. I hope you can help me and I thank you in advance for the time dedicated to this problem.

Answer:

To pass variables through ajax you must use the value data . In my case I used the POST method

$('#div-btn5').click(function(){
    var ci_v=<?php echo  $assoc_prosesar['ci'];  ?>;
    var id_tema_v=<?php echo $modulo['idTema']; ?>;
    $.ajax({
       type: "POST",
       url: "clases.php",
       data: {ci:ci_v,id_tema_v:id_tema},                  
       success: function(a) {
          $('#central').html(a);
       }
    });
});

And in clases.php process the information

if($_SERVER['REQUEST_METHOD']=="POST"){
    $ci=$_POST['ci'];
    $id_tema=$_POST['id_tema'];
}

Regarding the href:

It worked for me by putting everything in one echo. Example:

$ci=$assoc_prosesar['ci'];
$id_tema=$modulo['idTema'];
$e= addslashes($modulo['tema']);
$codificadoe = utf8_encode($e);
echo('<a  href="clases.php?ci='.$ci.'&id_tema='.$id_tema.'" id="div-btn5" >'.$codificadoe.'</a>');
Scroll to Top