Jump to content

Archived

This topic is now archived and is closed to further replies.

jcoones

**SOLVED** Get screen resolution with php?

Recommended Posts

Anyone know how to determine a browser's screen resolution with php or can it only be done with Javascript?

I want to set up an include file with some code that would say something like:

if(screen resolution is 800x600){
echo "<img src=Images/thisImage.gif>";
}
else {
echo "<img src=Images/anotherImage.gif>";
}


Thanks


Please ignore this post. I figured it out!

Thanks anyway. [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

Share this post


Link to post
Share on other sites
I don't think PHP can do this, but you can use Javascript instead.

[a href=\"http://www.pageresource.com/jscript/jscreen.htm\" target=\"_blank\"]http://www.pageresource.com/jscript/jscreen.htm[/a]

Share this post


Link to post
Share on other sites
[!--quoteo(post=377681:date=May 27 2006, 07:34 PM:name=jcoones)--][div class=\'quotetop\']QUOTE(jcoones @ May 27 2006, 07:34 PM) [snapback]377681[/snapback][/div][div class=\'quotemain\'][!--quotec--]

Please ignore this post. I figured it out!

[/quote]

Did you figure out how to do it in PHP? If so would you please post the solution so others may see.

Share this post


Link to post
Share on other sites
Not really! What I wanted to do was to have one image that would be displayed on every page of my site if a user's browser was set to 800x600 and another image that would be displayed if a user's browser was set to 1028x768.

What I ended up doing was creating a php include file that had a small Javascript in it and I included that file on each of my site pages.

A bit of a kludge but it works fine. [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]


Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.