Screen Resolution Help Needed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ralph Freshour

    Screen Resolution Help Needed

    Is there a way I can get the screen resolution using PHP? I want to
    set some parameters depending upon whether the user's screen is 800
    wide or 1024 wide.

    Thanks...

  • Keith Maika

    #2
    Re: Screen Resolution Help Needed

    Ralph Freshour wrote:[color=blue]
    > Is there a way I can get the screen resolution using PHP? I want to
    > set some parameters depending upon whether the user's screen is 800
    > wide or 1024 wide.
    >
    > Thanks...
    >[/color]

    You have to use javascript to retreive that and send it back to your
    server. You could make an intermediate redirecting page that gathers
    the information, then forwards the user to the main site with the screen
    resolution information attached to the url in the query string.

    <script type="text/javascript">
    window.location .href='realinde x.php?scrh='+sc reen.height+'&s crw='+screen.wi dth;
    </script>


    --
    http://kicken.mine.nu:8008/ - Personal Site
    http://wiser.kicks-ass.org:8008/ - Long-term Project
    Keith Maika

    Comment

    • RG

      #3
      Re: Screen Resolution Help Needed


      "Ralph Freshour" <ralph@primemai l.com> wrote in message
      news:6d8eivcb8p auv525ii99aa4cu ep6onohdq@4ax.c om...[color=blue]
      > Is there a way I can get the screen resolution using PHP? I want to
      > set some parameters depending upon whether the user's screen is 800
      > wide or 1024 wide.
      >
      > Thanks...
      >[/color]


      You should build your site properly, make it expandable
      RG


      Comment

      • Martin Lucas-Smith

        #4
        Re: Screen Resolution Help Needed



        [color=blue][color=green]
        > > Is there a way I can get the screen resolution using PHP? I want to
        > > set some parameters depending upon whether the user's screen is 800
        > > wide or 1024 wide.[/color][/color]

        There are practically no circumstances when this [which has to be done via
        Javascript, assuming the user's browser has javascript switched on - I
        think about 14% of people don't] is a good idea when designing for the
        web. Do you _really_ need to do this?

        What if my screen is set up to use 640x480, or I use a text browser, or if
        I'm a search engine?

        [color=blue]
        > You could make an intermediate redirecting page that gathers the
        > information, then forwards the user to the main site with the screen
        > resolution information attached to the url in the query string.[/color]

        Erm, you could do, but it's really not very advisable..



        Martin Lucas-Smith www.geog.cam.ac.uk/~mvl22



        Comment

        Working...