Good evening!
How could I store the data of the variable "test" in "$ variavelphp". The way the code today is the variable "test" is not accessible.
If it is not possible how could I access the value of the variable "test" in "test2" in another part of the code.
var ref = firebase.database().ref('Profissionais').orderByChild('Nome');
//var u = 0;
ref.on('child_added', function (snapshot) {
var profissional = snapshot.val();
if (profissional.provider == "usuarios" || profissional.provider == "Facebook" || profissional.provider == "Firebase" || profissional.provider == "Usuarios") {
teste = "<tr><td>" + snapshot.key + "</td><td>" + profissional.Nome + "</td><td>" + profissional.Email + "</td><td>" + profissional.provider + "</td><td><a href='usuario.php?id=" + snapshot.key + "' class='btn btn-round btn-fill btn-info'>Consultar</a></td></tr>";
}
});
</script>
<?php
$variavelphp = "<script>document.write(teste)</script>";
?>
<script type="text/javascript">
var teste2 = teste;
alert(teste2);
</script>