I have a file named index.php in which My Ajax is-->
<script>
$(document).ready(function() {
$("#tokensubmit").submit(function(e){
var id = $("#id").val();
$.ajax({
type: "POST",
url: "requests/abcd.php",
data: {login:true,id: id},
success: function(response){
alert(response);
}
}
});
e.preventDefault();
});
});
</script>
& OTHER FILE I HAVE WHICH IS "abcd.php" where i am sending ajax Request. abcd.php is like this ->
<?php include 'xyz.php'; ?>
In xyz.php if i type
<?php echo "abcd ";?>
My ajax is not working ! What i want to say is PHP INCLUDE is NOT working with Ajax Request.
But without including xyz.php in abcd.php If i write the code directly which is in xyz.php without including .. Everything is working fine..
But i want to include the file. How can i do that ? please help..