The page height is available to JavaScript. But you have to have JavaScript pass that data back to PHP either by putting the value on the URL or by submitting it with a post. Either way, you have to have the first page determine the height and pass it off when the 2nd page is called.