I'm trying to get clients viewport size inside php code, via jquery ajax, but something is wrong:
index.php
<body>
<script>
var h = $(window).height() - 83;
alert (h); // works
$.ajax({
type: "POST",
url: 'pass.php', // I also tried index.php directly
data: {h : h}
});
</script>
<?php
include ("pass.php");
$h = $_POST['h'];
echo $h; // doesn't work
?>
There is no echo in index.php.