0
Code from my home page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Salão de Beleza – Madame Nora</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="classes/jquery-2.1.1.js" ></script>
<script type="text/javascript" src="classes/jquery-2.1.1.min.js"></script>
<script type="text/javascript">
$(function(){
$("#btnDesativar").click(function(event) {
var aux = confirm('Deseja Realmente Desativar Conta?');
if(aux == true){
var acao = "1";
var url = "includes/conexaoIndex.php";
xmlHttp.onreadystatechange = stateChanged;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.send("acao="+acao);
}
});
});
</script>
</head>
<?php include "/includes/conexaoIndex.php"; ?>
<body>
<form id="loginUsuario" name="loginUsuario" action="" >
<button type="submit" id="btnDesativar" name="btnDesativar" >Desativar conta</button>
</form>
</body>
</html>
And on my other page, that’s all I have to test:
<?php
if (isset($_POST['acao']))
{
echo "aqui";}
?>
In my browser it looks like this:
http://localhost/Projeto/teste.php?btnDesativar=
Why doesn’t it work?
Welcome to the site, Icheli. The response times here are usually extremely fast, but asking for urgency is irrelevant. Your job is to make a cool headline, write in formal Portuguese, format the question well and describe the problem accurately. You can [Edit] the question whenever you need to format or clarify/add details.
– brasofilo
If you are using the jQuery framework why not take advantage to use the function itself
$.ajax
to communicate with the server?– CIRCLE