Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2003
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Screen Resolution

    Is there a variable to tell PHP what screen resolution the client is running?

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    PHP runs on the server. To get screen resolution you would have to use client-side javascript and then send that value to the server via either a POST or GET submission.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New Coder
    Join Date
    Mar 2003
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's no good... I hate javaScript...

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There's no other way besides using JavaScript...

    ...and having said that, I always wonder why people want to know the screen resolution. IMO that's a really uninteresting piece of information about the user's computer. What do I gain from knowing that the screen resolution is either 640 x 480 or 2860 x 1430? Nothing. It doesn't tell me anything about the size my webpage can occupy with visual content. The size of the canvas area in the browser window could be obtained via JavaScript, but hey, you can save yourself from this hassle if you chose a flexible design of your pages (that's what HTML is meant for).


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •