Screen resolution variable ?? + mobile

Discussion in 'PHP' started by mdrobiul, Mar 15, 2009.

  1. #1
    Can you tell me which vairable show the screen resolution and operation system of visitor?

    Another question: I'm thinking to redirect mobile/PDA phone visitor to mobile site. As many latest PDA/phone browsers directly take you to PC site(not wap site), so I want to check it with screen resolution. DO you support the idea ?
     
    mdrobiul, Mar 15, 2009 IP
  2. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #2
    HTTP User Agent makes more sense than screen resolution. Keep your browscap.ini file up to date and you'll have what you need.
     
    SmallPotatoes, Mar 15, 2009 IP
  3. Ilyes

    Ilyes Banned

    Messages:
    129
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Is it possible to see Screen resolution of a client in php ? ! I didn't know that !
     
    Ilyes, Mar 15, 2009 IP
  4. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Nope, you have to use Javascript or other client-side thingamajiggery.
     
    SmallPotatoes, Mar 15, 2009 IP
  5. mdrobiul

    mdrobiul Peon

    Messages:
    186
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    do you think that in case of using javascript, it will fetch any resolution and even earlier mobile phone wap browser resolution ?
     
    mdrobiul, Mar 16, 2009 IP
  6. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #6
    No. Many mobile phones have weird or nonexistent JavaScript implementations. Using JavaScript or making bold and unwarranted assumptions based on screen resolution is a foolish approach.

    Use $_SERVER['HTTP_USER_AGENT'] or get_browser() and you will get much more accurate information about the type of device you are talking to. It's what they're for.
     
    SmallPotatoes, Mar 16, 2009 IP