0
Next I want to pass a php variable to Javascript only in different files, I have a code template that is this:
$(document).ready(function(){
$("#botao").click(function(){
$.ajax({
url:'../../../consulta.php',
type: 'POST',
var senha = document.getElementById('#senha').value;
data: { senhap: 'senha',
success: function (data){
// me disseram que aqui o PHP me retorna alguma coisa, mas como eu vou
//tratar o resultado que vier por aqui?
}
});
});
});
I really don’t even know if the above code is totally right, someone could explain both the return of PHP and the part of "data{senhp: 'password',}" I thank you in advance!
And the rest of the code? What is the variable
PHP
who wants to pass?– William Aparecido Brandino
Just a variable $name that is in php, I wanted it to be three: $name, $age and $address, but only name per hour this good size, if only to js send me a Lert would be happy :)
– Froslass