I have a php file Filter page.php, where I am making the ajax call and also writing the logic The alert on success shows the correct data but when I am trying to echo the same in php, it is showing nothing
<html>
<body>
<?php
if(isset($_POST['grpNm'])){
echo $_POST['grpNm'];
var_dump($_POST['grpNm']);
}
?>
<script src="jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function(){
var GrpNm="ABC";
$.ajax({
type: "POST",
url: "FilterPage.php",
data: {grpNm : GrpNm},
success: function(data){
alert(data);
},
error: function(data){
alert("No");
},
});
});
</script>
</body>
</html>