PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Is it possible to have PHP (or possibly some other language) know a client's screen resolution?
A little background on my problem. I have a website that uses a bunch of picture which makes for a pretty darn nice backgound. The problem is, it only fits certain resolutions, otherwise a scrollbar appears (the one that moves left and right) and ruins the look of my whole site. So what I though I'd do is find out a user's resolution and judging by that, manupulate the picture sizes accordingly, something along the lines of:
I don't think you can get information using the HTTP_USER_AGENT. I thik that only returns your browser information. Can someone be more specific on how I do this using JavaScript or PHP?
I didn't think you could get it from PHP, therefore it won't work with PHP.
That said, it's time to do some digging. Javascript will do it. Just dig into the DOM (document object model) or something and find which object holds the data you want. Perhaps the screen.width element would be of some help. If so, just write out the correct background using document.write to the body tag.
Check out the Client Side forum, there's a few threads about this. Basically it all comes down to passing the information from JS to PHP 'cause PHP doesn't know anything about the client's set-up.
Nay, that really helps. I will look into that. Chances are I will also have to cookie that information in order to remeber it on each page of my website. This is sure to get annoying . Thanks.