Find variable value

0

Personal I have a candidate registration form. To save to the database it passes the values through the javascript to salvaCandidato.php . I'm trying to make sure that when I send the form the modal appears saying the subscription protocol that is in the $ nr_prot variable in SavedCandidate.php , I can not.

index.php

    <div class="modal fade" id="myModal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Observação</h4>
      </div>
      <div class="modal-body">
        <h4>Anote seu protocolo</h4>
        <h4>$nr_prot</h4>
        <h4> O protocolo foi enviado para o email </h4>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
      </div>
    </div>
  </div>
</div>

salvaCandidato.php

  $sqlProt = "SELECT * FROM candidato WHERE cpf_cand = '$_POST[cpf_cand]'";
  $queryProt = mysqli_query($conexao,$sqlProt);
  $fetchProtocolo = mysqli_fetch_assoc($queryProt);
  $nr_prot =  $fetchProtocolo['nr_prot'];
    
asked by anonymous 26.07.2018 / 23:06

1 answer

0

You can do this as follows:

<?php
  $variavelphp = "<script>document.write(variaveljs)</script>";
  echo "$variavelphp";
?>

You'll only edit variaveljs and put your variable!

.

I do not know if I can help you, but I hope so!

    
26.07.2018 / 23:20