我正在尝试阅读$ _POST ['name'],但我得到了未定义的索引,我做错了什么?
这里是剧本
<script>
$(document).ready(function(){
$.ajax({
type: "POST",
url:'TESTING.php',
data: {name: "Alfred"},
success: function(data){ //response param
alert(data);
}
});
});
</script>
我在这里打印POST
<?php
echo "Hi ";
//var_dump($_POST);
$nick = $_POST['name'];
echo $nick;
?>