Jump to content

**SOLVED** Get screen resolution with php?


jcoones

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\" /]
Link to comment
https://forums.phpfreaks.com/topic/10610-solved-get-screen-resolution-with-php/
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.
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\" /]


Archived

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

×
×
  • Create New...

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.