Lots of website do that already. in the first load send some script that would calculate with window height and width. then create a location redirection here is an example:
<script>
var width=get_window_width();var height=get_window_height();document.location='somelocation_or_samelocation.php?width='+width+'&Height='+height;
</script>