3
I have a code that does a validation in javascript, and I would like it to be validated as true, change a table of the database. I thought to use ajax, so as soon as validate as true, call a method in a.php file, but I don’t know how to do it.
It would be necessary to send a Session to ajax $_SESSION['membro'];
and ajax with that Session, change in the database where the member’s name is equal to that of Session.
It would be something like this?
$.ajax({
url: 'script.php', //caminho do arquivo a ser executado
dataType: 'html', //tipo do retorno
type: 'post', //metodo de envio
data: session:$_SESSION['membro'], //valores enviados ao script
});
The question is about this Javascript snippet, or about the PHP part?
– bfavaretto
About ajax. The method to change the table I know, do not know how to call it by sending this
SESSION
– GGirotto