You could possibly do something with JavaScript to get the current window size and send it via an AJAX request to a server-side script. But that would not tell you their screen resolution, just what size they currently have their browser set to. It might be more robust to default to a relatively "safe" size, then provide a link or two for the user to click if he wants the page displayed in a different resolution, saving their latest selection in the DB or a cookie.