Is there a PHP code for this? - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: Is there a PHP code for this? (/showthread.php?tid=69320) Is there a PHP code for this? by Woraug on 12-10-2006 at 02:49 AM Basically, what I'm wanting to do is have varying backgrounds for my site. I want to have the code detect what resolution whoever is visiting the site, and set a specified image as the background. If I set a small image as the background, it doesn't look good tiled or stretched. If I set a big image as a background, you can't see the whole thing, or it looks terrible downsized. RE: Is there a PHP code for this? by Menthix on 12-10-2006 at 03:02 AM
AFAIK resolution can only be detected with javascript. PHP will certainly not work, PHP runs serverside, the resolution is clientside. RE: Is there a PHP code for this? by Nathan on 12-10-2006 at 03:05 AM Meh you dont even need javascprt you can use css RE: Is there a PHP code for this? by Menthix on 12-10-2006 at 03:07 AM CSS can't detect the user's screen resolution or browser window resolution, and that was what he asked for. Correct me if i'm wrong. RE: Is there a PHP code for this? by Nathan on 12-10-2006 at 03:08 AM No but it can stretch to the width and height of the browser and thats all he wants from what i see. RE: Is there a PHP code for this? by Menthix on 12-10-2006 at 03:10 AM
quote: quote: RE: Is there a PHP code for this? by Nathan on 12-10-2006 at 03:12 AM
Hmm sorry, RE: Is there a PHP code for this? by rav0 on 12-10-2006 at 05:00 AM
I'd just but a big image as the backgroud, and if a user has their browser window smaller (or as big as it goes, but their screen resolution is low), let the image be cropped. RE: Is there a PHP code for this? by stu on 12-19-2006 at 03:09 AM
you could just use a script that detects what res they are using and redirect them to an appropriate page. not to sure how to just change the background picture though. To redirect them just use something like code:enter whatever values you want for the width and height RE: Is there a PHP code for this? by Woraug on 12-19-2006 at 10:20 AM
What would I do to that code to make it do like: RE: Is there a PHP code for this? by RaceProUK on 12-19-2006 at 10:35 AM Why not create a background that works when tiled? Backgrounds work best when simple. RE: Is there a PHP code for this? by Ezra on 12-19-2006 at 11:04 AM
Or have a javascript script that detects all these things and passes them to the server so you can work with these things in php. code: |