i'm trying to learn ajax for a new project, i need to upload data using some javascripts variables, so in order to start , i decided to try a small easy ajax problem , but i didnt work,
Notice: Undefined index: name in C:\Apache24\htdocs\d.php on line 4 is shown
My .js file :
<script>
$.ajax({
type: "POST",
url: 'd.php',
data: {name : "aa"},
success: function(output) {
alert(output);
}
error: function(request, status, error){
alert("Error: Could not delete");
}
);
</script>
My php file:
<?php
print_r($_POST['name']);
?>
Thank you