jcoones Posted May 27, 2006 Share Posted May 27, 2006 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>";}ThanksPlease 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\" /] Quote Link to comment https://forums.phpfreaks.com/topic/10610-solved-get-screen-resolution-with-php/ Share on other sites More sharing options...
poirot Posted May 27, 2006 Share Posted May 27, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/10610-solved-get-screen-resolution-with-php/#findComment-39569 Share on other sites More sharing options...
Allen4172 Posted May 28, 2006 Share Posted May 28, 2006 [!--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. Quote Link to comment https://forums.phpfreaks.com/topic/10610-solved-get-screen-resolution-with-php/#findComment-39777 Share on other sites More sharing options...
jcoones Posted May 31, 2006 Author Share Posted May 31, 2006 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\" /] Quote Link to comment https://forums.phpfreaks.com/topic/10610-solved-get-screen-resolution-with-php/#findComment-40695 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.