Here's the code I use and it doesn't work when I try echo $_POST['count'];
on
page.php
<input type="submit" value="go" id="more">
<script>
$(function(){
$('#more').click(function(event) {
event.preventDefault();
$.ajax({
type: "POST",
url: "page.php",
data: {"count":3} //saving number 3
});
});
});
</script>
In page.php.
<?php echo $_POST['count'];?> //doesn't work.