How to make a website PDA or Mobile Aware

Discussion in 'HTML & Website Design' started by thundercow, Feb 6, 2008.

  1. #1
    I hope I am even asking the right question here. I want to know how to make a version of my site that is PDA or Mobile aware. I'll explain: if I go to google with my mobile phone, it automatically takes me to a special page designed specifically for mobile browsers. Somehow google knows that I am using a mobile browser.

    Making a mobile friendly site is easy: small graphics, small navigation menus, etc. But, how do I recognize when browsers are mobile browsers, and then direct the browsers to a separate directorywith the leaner, mobile version of my site?
     
    thundercow, Feb 6, 2008 IP
  2. ToddMicheau

    ToddMicheau Active Member

    Messages:
    183
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Yes, this is possible, though you will need a server side scripting language to do it, and I would suggest PHP. What google does is it checks the headers that the browser sends and displays the page accordingly. If you don't know what headers are; they are the information that the browser sends to a web server when it connects, it includes info on what page to get, if the request is a GET or POST, the size of content (if any) that it's sending, what kind of browser it is, as well as several more. In php you can get access to these headers through $_SERVER['HTTP_USER_AGENT']

    Now knowing every header a phone sends out would be tricky for the normal person, unlike google. . . But check out this article for more info:

    http://www.developershome.com/wap/detection/detection.asp?page=userAgentHeader
     
    ToddMicheau, Feb 6, 2008 IP