I am trying to do a simple name change for a user, which will save their new name into a db. For the ajax call, I am running something like this
var new_name = prompt("Enter your new name" , "Charlie Murphy");
if(new_name == "" || new_name == null){
alert("Please actually enter a name");
}
else{
$.ajax({
url : "./db_scripts/change_name.php",
type : "POST",
data : {name : new_name}
});
My php goes
<?php
$new_name = $_POST['name'];
echo $new_name;
?>
Just to try and get the post to work, but the name is not printing to the browser. I am positive I have my path name right for the db_script, because I have other scripts that are working.
Help