Matthew,
To get the user's resolution you'll end up using JavaScript, and as such your code will rely entirely on what browser they're using. That's the first challenge -- figuring out what to do when the browser gives you absolutely no idea of what the user's resolution is. I'll also remind you that not all users run their browsers maximized, and even those who do don't always have their entire screen taken up by the browser -- for example, I have toolbars on the left and right sides of my screen -- thus, my resolution might differ from the browser's size by up to 150px. See what I mean?
The second challenge is getting the information from JavaScript to PHP. Most of the methods for doing this are less than intuitive. Some examples: You could have JavaScript write the values to hidden form fields and have the user submit the form. You could have JavaScript open a script with the values in the url (e.g. script.php?x=800&y=600...), but then you run the risk of the user quickly whacking the popup window. Or you could have the script return an image and call it with <img src="script.php?...">. As you can see, a lot of options, but none very intuitive. And, as you can tell, none of them allow you to use the info in PHP immediately -- they all require the user to go to a second page or reload the page before you can actually use the data.